webview optimize
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ declare module "SDPPPInternal" {
|
||||
workflowAgentSID: string,
|
||||
setWorkflowAgentSID: (workflowAgentSID: string) => void,
|
||||
|
||||
showWebviewDialog: () => void;
|
||||
toggleWebviewDialog: () => void;
|
||||
}
|
||||
|
||||
export function useSDPPPComfyCaller(): {
|
||||
|
||||
@@ -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({
|
||||
</div>
|
||||
) : ''
|
||||
}
|
||||
{!editorMode && (initAfter4s || webviewAgentSID) && <ComfyLogin
|
||||
onRequestLogin={() => { showWebviewDialog() }}
|
||||
/>}
|
||||
|
||||
<sp-divider size="small"></sp-divider>
|
||||
|
||||
|
||||
@@ -85,13 +85,13 @@ const AutoRunButtons = () => {
|
||||
|
||||
// 编辑按钮
|
||||
const EditButton = () => {
|
||||
const { workflowAgentSID, webviewAgentSID, showWebviewDialog } = useSDPPPContext();
|
||||
const { workflowAgentSID, webviewAgentSID, toggleWebviewDialog } = useSDPPPContext();
|
||||
const usingWebview = workflowAgentSID == webviewAgentSID;
|
||||
|
||||
return (
|
||||
<sp-action-button
|
||||
{...(!usingWebview ? { disabled: true } : {})}
|
||||
onClick={() => { showWebviewDialog() }}
|
||||
onClick={() => { toggleWebviewDialog() }}
|
||||
title={!usingWebview ? i18n('disabled when running in browser page') : i18n('Edit in ComfyUI')}
|
||||
>
|
||||
<WebEditIcon />
|
||||
|
||||
Reference in New Issue
Block a user