refactor: Update Twitter OAuth 2.0 PKCE flow for dynamic redirect URI and public client authentication, replace SVG back button with a native icon, and enhance Twitter login error reporting.

This commit is contained in:
pradeepkumar
2026-03-26 15:05:06 +05:30
parent 0466341f62
commit ba87e3b091
7 changed files with 135 additions and 54 deletions

View File

@@ -75,6 +75,7 @@ class MessagingNotifier extends StateNotifier<MessagingState> {
MessagingNotifier(this._repository, this._ref)
: super(const MessagingState()) {
_initSocketListeners();
loadUnreadCount();
}
String? get _currentUserId => _ref.read(authProvider).user?.id;
@@ -132,9 +133,15 @@ class MessagingNotifier extends StateNotifier<MessagingState> {
return c;
}).toList();
// Recalculate total unread count
final totalUnread = updatedConversations.fold<int>(
0, (sum, c) => sum + c.unreadCount,
);
state = state.copyWith(
messages: updatedMessages,
conversations: updatedConversations,
unreadCount: totalUnread,
);
}));
@@ -575,9 +582,13 @@ class MessagingNotifier extends StateNotifier<MessagingState> {
..remove(conversationId);
final updatedConversations =
state.conversations.where((c) => c.id != conversationId).toList();
final totalUnread = updatedConversations.fold<int>(
0, (sum, c) => sum + c.unreadCount,
);
state = state.copyWith(
messages: updatedMessages,
conversations: updatedConversations,
unreadCount: totalUnread,
clearActiveConversation: true,
);
} catch (_) {