Skip to content

Commit

Permalink
Merge pull request #314 from pangeachat/no-duplicate-selection
Browse files Browse the repository at this point in the history
No duplicate selection
  • Loading branch information
ggurdin authored Jun 10, 2024
2 parents 4620677 + 429d4a9 commit 7dc8ee2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1327,9 +1327,18 @@ class ChatController extends State<ChatPageWithRoom>
}
// Pangea#
if (!event.redacted) {
if (selectedEvents.contains(event)) {
// #Pangea
// If previous selectedEvent has same eventId, delete previous selectedEvent
final matches =
selectedEvents.where((e) => e.eventId == event.eventId).toList();
if (matches.isNotEmpty) {
// if (selectedEvents.contains(event)) {
// Pangea#
setState(
() => selectedEvents.remove(event),
// #Pangea
() => selectedEvents.remove(matches.first),
// () => selectedEvents.remove(event),
// Pangea#
);
} else {
setState(
Expand Down

0 comments on commit 7dc8ee2

Please sign in to comment.