fix: hide context bar actions

pull/8673/merge
Konstantinos Kaloutas 2023-03-27 12:04:21 +03:00 committed by Gabriel Horner
parent 0a1f5e059c
commit 4330f92746
1 changed files with 3 additions and 0 deletions

View File

@ -566,6 +566,9 @@ const getContextBarActionTypes = (type: ShapeType) => {
}
export const getContextBarActionsForShapes = (shapes: Shape[]) => {
const {isPublishing} = React.useContext(LogseqContext)
if (isPublishing) return []
const types = shapes.map(s => s.props.type)
const actionTypes = new Set(shapes.length > 0 ? getContextBarActionTypes(types[0]) : [])
for (let i = 1; i < types.length && actionTypes.size > 0; i++) {