From 73690e8bac2841f58bbf29aed8b77cd100439012 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 1 Nov 2021 15:15:12 -0700 Subject: [PATCH] Combined if statements --- lib/cwtch/cwtchNotifier.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index 7119233a..2f952dd0 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -149,8 +149,7 @@ class CwtchNotifier { var currentTotal = profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages; // Only bother to do anything if we know about the group and the provided index is greater than our current total... - if (currentTotal != null) { - if (idx >= currentTotal) { + if (currentTotal != null && idx >= currentTotal) { profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages = idx + 1; //if not currently open @@ -171,7 +170,6 @@ class CwtchNotifier { // and `local now`. profileCN.getProfile(data["ProfileOnion"])?.contactList.updateLastMessageTime(data["GroupID"], timestampSent.toLocal()); notificationManager.notify("New Message From Group!"); - } } } else { // from me (already displayed - do not update counter)