mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): if in dev mode, reset API on reconnect
This retains the current good developer experience when working on the server - the UI should fully reset when you restart the server.
This commit is contained in:
parent
9fcc30c3d6
commit
ff09fd30dc
@ -38,6 +38,12 @@ export const addSocketConnectedEventListener = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we are in development mode, reset the whole API state. In this scenario, reconnects will
|
||||
// typically be caused by reloading the server, in which case we do want to reset the whole API.
|
||||
if (import.meta.env.MODE === 'development') {
|
||||
dispatch(api.util.resetApiState());
|
||||
}
|
||||
|
||||
// Else, we need to compare the last-known queue status with the current queue status, re-fetching
|
||||
// everything if it has changed.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user