feat: implement social login functionality with Google, Facebook, and Twitter, including API integration and platform-specific configurations.
This commit is contained in:
@@ -423,7 +423,7 @@ class MessagingNotifier extends StateNotifier<MessagingState> {
|
||||
conversations: updatedConversations,
|
||||
isSending: false,
|
||||
);
|
||||
} catch (_) {
|
||||
} catch (e) {
|
||||
final messagesAfterError =
|
||||
List<ChatMessage>.from(state.messages[conversationId] ?? []);
|
||||
messagesAfterError.removeWhere((m) => m.id == tempId);
|
||||
@@ -432,10 +432,15 @@ class MessagingNotifier extends StateNotifier<MessagingState> {
|
||||
Map<String, List<ChatMessage>>.from(state.messages)
|
||||
..[conversationId] = messagesAfterError;
|
||||
|
||||
// Show specific error for connection-required failures
|
||||
final errorMsg = e.toString().contains('connection')
|
||||
? 'You must be connected to send messages'
|
||||
: 'Failed to send message';
|
||||
|
||||
state = state.copyWith(
|
||||
messages: errorMessages,
|
||||
isSending: false,
|
||||
error: 'Failed to send message',
|
||||
error: errorMsg,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user