fix(auth): prevent AuthNotifier auto-dispose causing theme toggle logout
Applied @persistentRiverpod annotation to AuthNotifier so it persists for app lifetime. Previously, theme changes could trigger AuthProvider rebuild via auto-dispose, causing AsyncLoading state and auth issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
265ca5959d
commit
6b6614f482
@@ -447,13 +447,13 @@ Dio coreApiClient(Ref ref) { ... }
|
||||
|
||||
**When to use `@persistentRiverpod`:**
|
||||
|
||||
| Use Case | Annotation |
|
||||
|----------|------------|
|
||||
| API clients with interceptors | `@persistentRiverpod` |
|
||||
| Theme/config providers | `@persistentRiverpod` |
|
||||
| Auth state provider | `@persistentRiverpod` |
|
||||
| Feature data providers | `@riverpod` (default) |
|
||||
| UI state providers | `@riverpod` (default) |
|
||||
| Use Case | Annotation | Example |
|
||||
|----------|------------|---------|
|
||||
| API clients with interceptors | `@persistentRiverpod` | `coreApiClient`, `tatlockApiClient` |
|
||||
| Auth state provider | `@persistentRiverpod` | `AuthNotifier` |
|
||||
| Theme/config providers | `@persistentRiverpod` | `ThemeNotifier` |
|
||||
| Feature data providers | `@riverpod` (default) | `ContainersNotifier` |
|
||||
| UI state providers | `@riverpod` (default) | `SearchFilterNotifier` |
|
||||
|
||||
## File Naming Conventions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user