소스 검색

fix: hide context bar actions

Konstantinos Kaloutas 2 년 전
부모
커밋
4330f92746
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx

+ 3 - 0
tldraw/apps/tldraw-logseq/src/components/ContextBar/contextBarActionFactory.tsx

@@ -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++) {