diff --git a/ui/src/App.tsx b/ui/src/App.tsx index bb96b9b..866e8d3 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -176,7 +176,7 @@ export default function App() { const checkIsDirty = async () => { if (curFlowID.current != null) { - const curWorkflow = await workflowsTable?.get(curFlowID.current); + const curWorkflow = await workflowsTable?.get(curFlowID.current, false); return !!curWorkflow && checkIsDirtyImpl(curWorkflow); } return false; @@ -391,7 +391,6 @@ export default function App() { graphAppSetup(); setLoadChild(true); autoSaveTimer.current = setInterval(async () => { - return; const autoSaveEnabled = (await userSettingsTable?.getSetting("autoSave")) ?? true; diff --git a/ui/src/apis/TwowaySyncApi.ts b/ui/src/apis/TwowaySyncApi.ts index 3391b1d..796cd22 100644 --- a/ui/src/apis/TwowaySyncApi.ts +++ b/ui/src/apis/TwowaySyncApi.ts @@ -76,7 +76,7 @@ export namespace TwowaySyncAPI { const absPath = sanitizeAbsPath( `${myWorkflowsDir}/${parentFolderID ?? ""}/${name}.json`, ); - console.log("get abs path 🔥 workfoow", absPath); + console.warn("get abs path 🔥 workfoow", absPath); try { const response = await fetch("/workspace/get_workflow_file", { method: "POST", diff --git a/ui/src/db-tables/WorkflowsTable.ts b/ui/src/db-tables/WorkflowsTable.ts index a5ac41f..d11f165 100644 --- a/ui/src/db-tables/WorkflowsTable.ts +++ b/ui/src/db-tables/WorkflowsTable.ts @@ -48,7 +48,7 @@ export class WorkflowsTable extends TableBase { */ public async latestVersionCheck() { if (this._curWorkflow) { - const curFlowInDB = await this.get(this._curWorkflow.id); + const curFlowInDB = await indexdb.workflows.get(this._curWorkflow.id); if (curFlowInDB) { return curFlowInDB?.updateTime === this._curWorkflow.updateTime; } @@ -263,10 +263,13 @@ export class WorkflowsTable extends TableBase { return sortFileItem(all, sortBy ?? ESortTypes.RECENTLY_MODIFIED); } - public async get(id: string): Promise { + public async get( + id: string, + needJsonContent = true, //if false, only get the meta info from indexdb + ): Promise { const twoWaySyncEnabled = await userSettingsTable?.getSetting("twoWaySync"); const wf = await indexdb.workflows.get(id); - if (!twoWaySyncEnabled) { + if (!twoWaySyncEnabled || !needJsonContent) { return wf; } // two way sync mode