WebDAV sync: make config per-vault so switching vaults no longer cross-contaminates remotes; migrate existing global config

to the active vault
This commit is contained in:
Yuri Karamian
2026-06-27 01:08:02 +02:00
parent ffd9ebad7e
commit a43bf05bf0
5 changed files with 116 additions and 28 deletions
+7
View File
@@ -6,6 +6,7 @@ import type {
NoteEntry,
NoteContent,
NotebookEntry,
VaultConfig,
VaultState,
ViewMode,
SortMode,
@@ -13,6 +14,12 @@ import type {
// App state
export const appConfig = writable<AppConfig | null>(null);
// The active vault's config entry (where per-vault WebDAV sync settings live).
export function activeVaultConfig(c: AppConfig | null): VaultConfig | null {
if (!c?.active_vault) return null;
return c.vaults.find((v) => v.path === c.active_vault) ?? null;
}
export const vaultReady = writable(false);
// UI state