feat: Enhance messaging read receipts and auto-read, fix auth 401 error suppression during logout, and refine agent profile expertise
This commit is contained in:
@@ -97,6 +97,8 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
|
||||
try {
|
||||
final user = await _repository.getMe();
|
||||
// Re-enable auth error handling after successful login
|
||||
ApiClient.suppressAuthErrors = false;
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.authenticated,
|
||||
user: user,
|
||||
@@ -113,6 +115,8 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
// Suppress 401 errors during logout to prevent SnackBar flashing
|
||||
ApiClient.suppressAuthErrors = true;
|
||||
// Reset state first so UI navigates to login immediately
|
||||
state = const AuthState();
|
||||
// Disconnect socket immediately
|
||||
@@ -151,6 +155,7 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
return;
|
||||
}
|
||||
|
||||
ApiClient.suppressAuthErrors = false;
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.authenticated,
|
||||
user: result['user'] as UserModel,
|
||||
|
||||
Reference in New Issue
Block a user