Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(sync): propagate folder create and rename to cloud

Gabriel Stein2c1c5213e69a
diff --git a/src/helpers/database.js b/src/helpers/database.js
index 75b3d845f..286aba431 100644
--- a/src/helpers/database.js
+++ b/src/helpers/database.js
@@ -931,7 +931,9 @@ class DatabaseManager {
.prepare("SELECT id FROM folders WHERE name = ? AND id != ?")
.get(trimmed, id);
if (existing) return { success: false, error: "A folder with that name already exists" };
- this.db.prepare("UPDATE folders SET name = ? WHERE id = ?").run(trimmed, id);
+ this.db
+ .prepare("UPDATE folders SET name = ?, sync_status = 'pending' WHERE id = ?")
+ .run(trimmed, id);
const updated = this.db.prepare("SELECT * FROM folders WHERE id = ?").get(id);
return { success: true, folder: updated };
} catch (error) {
diff --git a/src/hooks/useFolderManagement.ts b/src/hooks/useFolderManagement.ts
index 6b644c58b..4f44af548 100644
--- a/src/hooks/useFolderManagement.ts
+++ b/src/hooks/useFolderManagement.ts
@@ -164,6 +164,7 @@ export function useFolderManagement(): UseFolderManagementReturn {
if (result.success && result.folder) {
await loadFolders();
setActiveFolderId(result.folder.id);
+ syncService.debouncedPush("folder", result.folder.id);
} else if (result.error) {
toast({
title: t("notes.folders.couldNotCreate"),
@@ -186,6 +187,7 @@ export function useFolderManagement(): UseFolderManagementReturn {
const result = await window.electronAPI.renameFolder(renamingFolderId, trimmed);
if (result.success) {
await loadFolders();
+ syncService.debouncedPush("folder", renamingFolderId);
} else if (result.error) {
toast({
title: t("notes.folders.couldNotRename"),