From d40cefb07026feb20d05e6161073f993878ef26d Mon Sep 17 00:00:00 2001 From: zombieyang Date: Tue, 8 Apr 2025 20:19:12 +0800 Subject: [PATCH] webview optimize --- typescripts/src/plugins/photoshop/index.d.ts | 2 +- typescripts/src/plugins/photoshop/tsx/Content.tsx | 7 +------ typescripts/src/plugins/photoshop/tsx/WorkflowEditWrap.tsx | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/typescripts/src/plugins/photoshop/index.d.ts b/typescripts/src/plugins/photoshop/index.d.ts index a421014..f8d467f 100644 --- a/typescripts/src/plugins/photoshop/index.d.ts +++ b/typescripts/src/plugins/photoshop/index.d.ts @@ -20,7 +20,7 @@ declare module "SDPPPInternal" { workflowAgentSID: string, setWorkflowAgentSID: (workflowAgentSID: string) => void, - showWebviewDialog: () => void; + toggleWebviewDialog: () => void; } export function useSDPPPComfyCaller(): { diff --git a/typescripts/src/plugins/photoshop/tsx/Content.tsx b/typescripts/src/plugins/photoshop/tsx/Content.tsx index d70c191..74b7584 100644 --- a/typescripts/src/plugins/photoshop/tsx/Content.tsx +++ b/typescripts/src/plugins/photoshop/tsx/Content.tsx @@ -1,5 +1,3 @@ -// @ts-ignore -import { ComfyLogin } from "./SDPPPInternalBridge.js"; import { useSDPPPContext } from "./SDPPPInternalBridge.js"; import i18n, { isValidI18nKey } from "../../../common/i18n.mjs"; import WebPageList from "./WebPageList.js"; @@ -31,7 +29,7 @@ export function Content({ webviewAgentSID, lastConnectErrorMessage, - showWebviewDialog, + toggleWebviewDialog, } = useSDPPPContext(); @@ -68,9 +66,6 @@ export function Content({ ) : '' } - {!editorMode && (initAfter4s || webviewAgentSID) && { showWebviewDialog() }} - />} diff --git a/typescripts/src/plugins/photoshop/tsx/WorkflowEditWrap.tsx b/typescripts/src/plugins/photoshop/tsx/WorkflowEditWrap.tsx index 0e64167..2652012 100644 --- a/typescripts/src/plugins/photoshop/tsx/WorkflowEditWrap.tsx +++ b/typescripts/src/plugins/photoshop/tsx/WorkflowEditWrap.tsx @@ -85,13 +85,13 @@ const AutoRunButtons = () => { // 编辑按钮 const EditButton = () => { - const { workflowAgentSID, webviewAgentSID, showWebviewDialog } = useSDPPPContext(); + const { workflowAgentSID, webviewAgentSID, toggleWebviewDialog } = useSDPPPContext(); const usingWebview = workflowAgentSID == webviewAgentSID; return ( { showWebviewDialog() }} + onClick={() => { toggleWebviewDialog() }} title={!usingWebview ? i18n('disabled when running in browser page') : i18n('Edit in ComfyUI')} >