mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-29 23:08:44 +10:00
fix(chat): address mark-as-unread double-pop and missed map entry point
- Remove stray Navigator.pop(context) in _markAsUnread for both contact and channel chats so the action no longer exits the conversation - Thread initialUnreadCount through map discovered-contact "Open Chat" button so the unread divider/jump still fires from that entry point Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -400,7 +400,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
if (found && !m.isOutgoing) count++;
|
if (found && !m.isOutgoing) count++;
|
||||||
}
|
}
|
||||||
connector.setChannelUnreadCount(widget.channel.index, count);
|
connector.setChannelUnreadCount(widget.channel.index, count);
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMessageBubble(ChannelMessage message, double textScale) {
|
Widget _buildMessageBubble(ChannelMessage message, double textScale) {
|
||||||
|
|||||||
@@ -543,7 +543,6 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
if (found && !m.isOutgoing && !m.isCli) count++;
|
if (found && !m.isOutgoing && !m.isCli) count++;
|
||||||
}
|
}
|
||||||
connector.setContactUnreadCount(widget.contact.publicKeyHex, count);
|
connector.setContactUnreadCount(widget.contact.publicKeyHex, count);
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildInputBar(MeshCoreConnector connector) {
|
Widget _buildInputBar(MeshCoreConnector connector) {
|
||||||
|
|||||||
@@ -1463,11 +1463,16 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
if (!contact.isActive) {
|
if (!contact.isActive) {
|
||||||
connector.importDiscoveredContact(contact);
|
connector.importDiscoveredContact(contact);
|
||||||
}
|
}
|
||||||
|
final unread =
|
||||||
|
connector.getUnreadCountForContactKey(contact.publicKeyHex);
|
||||||
Navigator.pop(dialogContext);
|
Navigator.pop(dialogContext);
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => ChatScreen(contact: contact),
|
builder: (context) => ChatScreen(
|
||||||
|
contact: contact,
|
||||||
|
initialUnreadCount: unread,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user