mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add $store to window in dev mode
Helpful for troubleshooting.
This commit is contained in:
parent
06245bc761
commit
ebe717099e
@ -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 (
|
||||
|
@ -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<ReturnType<typeof createStore>> | undefined
|
||||
>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user