feat: Implement expandable tag sections with "Show More/Less" functionality on the agent home screen.
This commit is contained in:
@@ -216,7 +216,12 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
|
||||
Future<void> verifyTwoFactor(String token) async {
|
||||
final tempToken = state.tempToken;
|
||||
if (tempToken == null) return;
|
||||
if (tempToken == null) {
|
||||
state = state.copyWith(
|
||||
errorMessage: 'Session expired. Please login again.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.loading,
|
||||
@@ -235,13 +240,16 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
_connectSocket();
|
||||
_initPushNotifications();
|
||||
} on ApiException catch (e) {
|
||||
// Preserve tempToken and requiresTwoFactor so user can retry
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.initial,
|
||||
requiresTwoFactor: true,
|
||||
errorMessage: e.message,
|
||||
);
|
||||
} catch (e) {
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.initial,
|
||||
requiresTwoFactor: true,
|
||||
errorMessage: 'Verification failed. Please try again.',
|
||||
);
|
||||
}
|
||||
@@ -249,7 +257,12 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
|
||||
Future<void> verifyBackupCode(String backupCode) async {
|
||||
final tempToken = state.tempToken;
|
||||
if (tempToken == null) return;
|
||||
if (tempToken == null) {
|
||||
state = state.copyWith(
|
||||
errorMessage: 'Session expired. Please login again.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.loading,
|
||||
@@ -270,11 +283,13 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
} on ApiException catch (e) {
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.initial,
|
||||
requiresTwoFactor: true,
|
||||
errorMessage: e.message,
|
||||
);
|
||||
} catch (e) {
|
||||
state = state.copyWith(
|
||||
status: AuthStatus.initial,
|
||||
requiresTwoFactor: true,
|
||||
errorMessage: 'Verification failed. Please try again.',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user