mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 00:49:17 +01:00
Handle external files
This commit is contained in:
@@ -10,6 +10,7 @@ import { jotaiStore } from '../lib/jotai';
|
||||
export function initSync() {
|
||||
initModelListeners();
|
||||
initFileChangeListeners();
|
||||
sync().catch(console.error);
|
||||
}
|
||||
|
||||
export async function sync({ force }: { force?: boolean } = {}) {
|
||||
@@ -53,6 +54,7 @@ function initFileChangeListeners() {
|
||||
await unsub?.(); // Unsub to previous
|
||||
const workspaceMeta = jotaiStore.get(workspaceMetaAtom);
|
||||
if (workspaceMeta == null || workspaceMeta.settingSyncDir == null) return;
|
||||
debouncedSync(); // Perform an initial sync when switching workspace
|
||||
unsub = watchWorkspaceFiles(
|
||||
workspaceMeta.workspaceId,
|
||||
workspaceMeta.settingSyncDir,
|
||||
|
||||
Reference in New Issue
Block a user