mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): reduce reconnect requests
- Add checks to the "recovery" logic for socket connect events to reduce the number of network requests. - Remove the `isInitialized` state from `systemSlice` and make it a nanostore local to the socketConnected listener. It didn't need to be global state. It's also now more clearly named `isFirstConnection`. - Export the queue status selector (minor improvement, memoizes it correctly).
This commit is contained in:
@ -26,7 +26,6 @@ import type { Language, SystemState } from './types';
|
||||
|
||||
export const initialSystemState: SystemState = {
|
||||
_version: 1,
|
||||
isInitialized: false,
|
||||
isConnected: false,
|
||||
shouldConfirmOnDelete: true,
|
||||
enableImageDebugging: false,
|
||||
@ -85,9 +84,6 @@ export const systemSlice = createSlice({
|
||||
) {
|
||||
state.shouldEnableInformationalPopovers = action.payload;
|
||||
},
|
||||
isInitializedChanged(state, action: PayloadAction<boolean>) {
|
||||
state.isInitialized = action.payload;
|
||||
},
|
||||
},
|
||||
extraReducers(builder) {
|
||||
/**
|
||||
@ -206,7 +202,6 @@ export const {
|
||||
shouldUseNSFWCheckerChanged,
|
||||
shouldUseWatermarkerChanged,
|
||||
setShouldEnableInformationalPopovers,
|
||||
isInitializedChanged,
|
||||
} = systemSlice.actions;
|
||||
|
||||
export default systemSlice.reducer;
|
||||
|
@ -44,7 +44,6 @@ export const isLanguage = (v: unknown): v is Language =>
|
||||
|
||||
export interface SystemState {
|
||||
_version: 1;
|
||||
isInitialized: boolean;
|
||||
isConnected: boolean;
|
||||
shouldConfirmOnDelete: boolean;
|
||||
enableImageDebugging: boolean;
|
||||
|
Reference in New Issue
Block a user