diff --git a/src/components/StackedNote.vue b/src/components/StackedNote.vue index 523770c..bc8cf31 100644 --- a/src/components/StackedNote.vue +++ b/src/components/StackedNote.vue @@ -100,6 +100,7 @@ useTitleNotes(repo) const store = useUserRepoStore() const hasBacklinks = computed(() => store.userSettings?.backlink) +const canPush = computed(() => store.canPush) const { displayNoteOverlay } = useNoteOverlay(className.value, index) const displayedTitle = computed(() => filenameToNoteTitle(props.title ?? "")) @@ -303,7 +304,7 @@ const onBadgeClick = async () => { class="action" /> - +
diff --git a/src/views/TodoNotes.vue b/src/views/TodoNotes.vue index 59a9d22..27c1ab3 100644 --- a/src/views/TodoNotes.vue +++ b/src/views/TodoNotes.vue @@ -26,9 +26,10 @@ const todoNote = computed(() => const sha = computed(() => todoNote.value?.sha ?? "") const path = computed(() => todoNote.value?.path) +const canPush = computed(() => store.canPush) + const { toHTML } = markdownBuilder(repo) -// Setup checkbox commit handler const { pendingContent, syncContent, listenToCheckboxes, hasPendingChanges } = useCheckboxCommit({ user: props.user, @@ -37,7 +38,8 @@ const { pendingContent, syncContent, listenToCheckboxes, hasPendingChanges } = initialContent: "", initialSha: sha, containerSelector: ".todo-notes .note-display", - debounceMs: 1000 + debounceMs: 1000, + enabled: canPush }) // Render pending content to HTML for display @@ -64,9 +66,9 @@ watch( { immediate: true } ) -// Setup checkbox listeners when content renders +// Setup checkbox listeners when content renders or canPush changes watch( - renderedContent, + [renderedContent, canPush], async () => { await nextTick() listenToCheckboxes()