MCPcopy Create free account
hub / github.com/massCodeIO/massCode / registerMainMenuContextSync

Function registerMainMenuContextSync

src/renderer/ipc/main-menu/sync.ts:34–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32const { contentSortState } = useContentSort()
33
34export function registerMainMenuContextSync() {
35 watch(
36 () =>
37 [
38 getActiveSpaceId(),
39 codeLayoutMode.value,
40 isCompactListMode.value,
41 isAvailableToCodePreview.value,
42 selectedSnippetContent.value?.language,
43 isShowCodePreview.value,
44 isShowJsonVisualizer.value,
45 Boolean(selectedNote.value),
46 isNotesMindmapShown.value,
47 isNotesPresentationShown.value,
48 notesLayoutMode.value,
49 notesEditorMode.value,
50 httpLayoutMode.value,
51 contentSortState.code.sort,
52 contentSortState.code.order,
53 contentSortState.notes.sort,
54 contentSortState.notes.order,
55 contentSortState.http.sort,
56 contentSortState.http.order,
57 contentSortState.math.sort,
58 contentSortState.math.order,
59 contentSortState.drawings.sort,
60 contentSortState.drawings.order,
61 currentDraft.value?.url,
62 isExecuting.value,
63 ] as const,
64 () => {
65 ipc.send(
66 'main-menu:update-context',
67 createMainMenuContext({
68 activeSpaceId: getActiveSpaceId(),
69 compactListMode: isCompactListMode.value,
70 contentSort: {
71 code: { ...contentSortState.code },
72 notes: { ...contentSortState.notes },
73 http: { ...contentSortState.http },
74 math: { ...contentSortState.math },
75 drawings: { ...contentSortState.drawings },
76 },
77 code: {
78 canPreviewCode: isAvailableToCodePreview.value,
79 canPreviewJson: selectedSnippetContent.value?.language === 'json',
80 isCodePreviewShown: isShowCodePreview.value,
81 isJsonPreviewShown: isShowJsonVisualizer.value,
82 layoutMode: codeLayoutMode.value,
83 },
84 notes: {
85 hasSelectedNote: Boolean(selectedNote.value),
86 isMindmapShown: isNotesMindmapShown.value,
87 isPresentationShown: isNotesPresentationShown.value,
88 layoutMode: notesLayoutMode.value,
89 mode: notesEditorMode.value,
90 },
91 http: {

Callers 1

Calls 2

getActiveSpaceIdFunction · 0.90
createMainMenuContextFunction · 0.90

Tested by

no test coverage detected