update file workf
This commit is contained in:
+1
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -48,7 +48,7 @@ export class WorkflowsTable extends TableBase<Workflow> {
|
||||
*/
|
||||
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<Workflow> {
|
||||
return sortFileItem(all, sortBy ?? ESortTypes.RECENTLY_MODIFIED);
|
||||
}
|
||||
|
||||
public async get(id: string): Promise<Workflow | undefined> {
|
||||
public async get(
|
||||
id: string,
|
||||
needJsonContent = true, //if false, only get the meta info from indexdb
|
||||
): Promise<Workflow | undefined> {
|
||||
const twoWaySyncEnabled = await userSettingsTable?.getSetting("twoWaySync");
|
||||
const wf = await indexdb.workflows.get(id);
|
||||
if (!twoWaySyncEnabled) {
|
||||
if (!twoWaySyncEnabled || !needJsonContent) {
|
||||
return wf;
|
||||
}
|
||||
// two way sync mode
|
||||
|
||||
Reference in New Issue
Block a user