Skip to content

Commit 22a0642

Browse files
Skip CKHub sync for view-only notebooks (#153)
1 parent ad25719 commit 22a0642

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,19 @@ async function handleNotebookSharing(
8686
) {
8787
const notebookContent = notebookPanel.context.model.toJSON() as INotebookContent;
8888

89+
const isViewOnly = notebookContent.metadata?.isSharedNotebook === true;
8990
const sharedId = notebookContent.metadata?.sharedId as string | undefined;
9091
const defaultName = generateDefaultNotebookName();
9192

9293
try {
94+
if (isViewOnly) {
95+
// Skip CKHub sync for view-only notebooks
96+
console.log('View-only notebook: skipping CKHub sync and showing share URL.');
97+
if (manual) {
98+
await showShareDialog(sharingService, notebookContent);
99+
}
100+
return;
101+
}
93102
if (sharedId) {
94103
console.log('Updating notebook:', sharedId);
95104
await sharingService.update(sharedId, notebookContent);

0 commit comments

Comments
 (0)