Comfy-Org / Comfy-Org/ComfyUI_frontend
Implement store reset methods to enable router-based login/logout
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Context
Currently, the application uses `window.location.reload()` on logout because `router.push()` doesn't invalidate all app state, which causes issues when changing accounts.
## Problem
When using `router.push()` for logout, state persists across account changes. For example, `isSettingsReady` remains true, causing new users to inherit previous users' cached settings.
## Desired Outcome
Implement proper store reset methods in `bootstrapStore` and `settingStore` (and any other stores that need cleanup) so that logout can use `router.push()` instead of `window.location.reload()`.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8307
- Discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8307#discussion_r2729390263
- Requester: @DrJKL
## Affected Files
- `src/stores/bootstrapStore.ts` - needs reset method
- `src/platform/settings/settingStore.ts` - needs reset method
- `SidebarLogoutIcon.vue` - should use router.push() after stores have reset capabilities
- Other stores may also need reset methods for complete state cleanup
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-8337-Implement-store-reset-methods-to-enable-router-based-login-logout-2f56d73d3650818cb38dfeee839b86ca) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.