diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 94fb0dcae6..19eecef881 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -143,6 +143,15 @@ const InvokeAIUI = ({ useEffect(() => { $store.set(store); + if (import.meta.env.MODE === 'development') { + window.$store = $store; + } + () => { + $store.set(undefined); + if (import.meta.env.MODE === 'development') { + window.$store = undefined; + } + }; }, [store]); return ( diff --git a/invokeai/frontend/web/src/app/store/nanostores/store.ts b/invokeai/frontend/web/src/app/store/nanostores/store.ts index 2bf2700893..59eba50e87 100644 --- a/invokeai/frontend/web/src/app/store/nanostores/store.ts +++ b/invokeai/frontend/web/src/app/store/nanostores/store.ts @@ -1,6 +1,13 @@ import type { createStore } from 'app/store/store'; import { atom } from 'nanostores'; +// Inject socket options and url into window for debugging +declare global { + interface Window { + $store?: typeof $store; + } +} + export const $store = atom< Readonly> | undefined >();