From dac82adb5b61ed953e129b89f0db8faa6ce92af2 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 14 May 2023 18:41:11 +1000 Subject: [PATCH 1/2] fix(ui): make logo component non-selectable --- .../system/components/InvokeAILogoComponent.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx index e736450563..a38a751b8b 100644 --- a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx +++ b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx @@ -17,8 +17,17 @@ const InvokeAILogoComponent = () => { h="32px" minW="32px" minH="32px" + userSelect="none" /> - + invoke ai From f5df1500973ef73accd886b47a0b2a4382a7ca8f Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 14 May 2023 18:42:15 +1000 Subject: [PATCH 2/2] feat(ui): add callback to signal app is ready needed for commercial --- .../frontend/web/src/app/components/App.tsx | 17 ++++++++++++++++- .../web/src/app/components/InvokeAIUI.tsx | 15 +++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/app/components/App.tsx b/invokeai/frontend/web/src/app/components/App.tsx index 3fbcbc49ea..eb6496f43e 100644 --- a/invokeai/frontend/web/src/app/components/App.tsx +++ b/invokeai/frontend/web/src/app/components/App.tsx @@ -30,9 +30,14 @@ const DEFAULT_CONFIG = {}; interface Props { config?: PartialAppConfig; headerComponent?: ReactNode; + setIsReady?: (isReady: boolean) => void; } -const App = ({ config = DEFAULT_CONFIG, headerComponent }: Props) => { +const App = ({ + config = DEFAULT_CONFIG, + headerComponent, + setIsReady, +}: Props) => { useToastWatcher(); useGlobalHotkeys(); @@ -61,6 +66,16 @@ const App = ({ config = DEFAULT_CONFIG, headerComponent }: Props) => { setLoadingOverridden(true); }, []); + useEffect(() => { + if (isApplicationReady && setIsReady) { + setIsReady(true); + } + + return () => { + setIsReady && setIsReady(false); + }; + }, [isApplicationReady, setIsReady]); + return ( {isLightboxEnabled && } diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 442c1d967a..c04a8184d7 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -24,9 +24,16 @@ interface Props extends PropsWithChildren { token?: string; config?: PartialAppConfig; headerComponent?: ReactNode; + setIsReady?: (isReady: boolean) => void; } -const InvokeAIUI = ({ apiUrl, token, config, headerComponent }: Props) => { +const InvokeAIUI = ({ + apiUrl, + token, + config, + headerComponent, + setIsReady, +}: Props) => { useEffect(() => { // configure API client token if (token) { @@ -55,7 +62,11 @@ const InvokeAIUI = ({ apiUrl, token, config, headerComponent }: Props) => { }> - +