Skip to content

Commit c605bce

Browse files
fix: only show sync mode notice when sync commands are executed, not when command palette opens (#864)
- Updated sync-discourse-nodes-to-supabase command to check !checking before showing notice - Updated publish-discourse-node command to check !checking before showing notice - Ensures 'Sync mode is not enabled' notice only appears when user clicks sync operations - Prevents notice from appearing when command palette is opened Resolves ENG-1517 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
1 parent 2d97224 commit c605bce

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/obsidian/src/utils/registerCommands.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
229229
name: "Sync discourse nodes to Supabase",
230230
checkCallback: (checking: boolean) => {
231231
if (!plugin.settings.syncModeEnabled) {
232-
new Notice("Sync mode is not enabled", 3000);
232+
if (!checking) {
233+
new Notice("Sync mode is not enabled", 3000);
234+
}
233235
return false;
234236
}
235237
if (!checking) {
@@ -252,7 +254,9 @@ export const registerCommands = (plugin: DiscourseGraphPlugin) => {
252254
name: "Publish current node to lab space",
253255
checkCallback: (checking: boolean) => {
254256
if (!plugin.settings.syncModeEnabled) {
255-
new Notice("Sync mode is not enabled", 3000);
257+
if (!checking) {
258+
new Notice("Sync mode is not enabled", 3000);
259+
}
256260
return false;
257261
}
258262
const activeView = plugin.app.workspace.getActiveViewOfType(MarkdownView);

0 commit comments

Comments
 (0)