fix version load

This commit is contained in:
Weixuan Fu
2024-06-26 16:51:44 +08:00
parent 23652905c9
commit ee2a3a2d2c
2 changed files with 2 additions and 5 deletions
@@ -206,7 +206,6 @@ export function VersionHistoryDrawer({ onClose }: { onClose: () => void }) {
return;
}
app.loadGraphData(JSON.parse(version.json));
loadWorkflowID(curFlow!.id, version.id);
onClose();
}}
>
+2 -4
View File
@@ -2,6 +2,7 @@ import { IconLink, IconLock, IconWorld } from "@tabler/icons-react";
import { CustomSelectorOption } from "../components/CustomSelector";
import { Workflow, WorkflowPrivacy } from "../types/dbTypes";
import { app } from "../utils/comfyapp";
import { userSettingsTable } from "../db-tables/WorkspaceDB";
export function generateRandomKey(length: number) {
// Generate a random array of bytes
@@ -60,10 +61,7 @@ export const getNodeDefs = () => {
export async function fetchCloudWorkflowPrivacy(
workflow: Workflow,
): Promise<WorkflowPrivacy> {
const cloudOrigin = workflow.cloudOrigin;
if (!cloudOrigin) {
throw Error("cloudURL is required");
}
const cloudOrigin = userSettingsTable?.settings?.cloudHost;
return fetch(cloudOrigin + `/api/getWorkflow?id=${workflow.cloudID}`)
.then((res) => res.json())
.then((json) => {