From ee2a3a2d2cdfce7eb27b49c6ae153f22bf40f5a4 Mon Sep 17 00:00:00 2001 From: Weixuan Fu Date: Wed, 26 Jun 2024 16:51:44 +0800 Subject: [PATCH] fix version load --- ui/src/components/VersionHistoryDrawer.tsx | 1 - ui/src/share/shareUtils.tsx | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ui/src/components/VersionHistoryDrawer.tsx b/ui/src/components/VersionHistoryDrawer.tsx index fecaeed..51d2965 100644 --- a/ui/src/components/VersionHistoryDrawer.tsx +++ b/ui/src/components/VersionHistoryDrawer.tsx @@ -206,7 +206,6 @@ export function VersionHistoryDrawer({ onClose }: { onClose: () => void }) { return; } app.loadGraphData(JSON.parse(version.json)); - loadWorkflowID(curFlow!.id, version.id); onClose(); }} > diff --git a/ui/src/share/shareUtils.tsx b/ui/src/share/shareUtils.tsx index 65ed32f..1624902 100644 --- a/ui/src/share/shareUtils.tsx +++ b/ui/src/share/shareUtils.tsx @@ -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 { - 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) => {