浏览代码

NotificationsActivity: Prevent simulatenous handleNotification + refresh

Peter Cai 1 年之前
父节点
当前提交
87fc1cd2f8
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt

+ 4 - 2
app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt

@@ -180,8 +180,9 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
                         withContext(Dispatchers.IO) {
                             euiccChannel.lpa.handleNotification(notification.inner.seqNumber)
                         }
+
+                        refresh()
                     }
-                    refresh()
                     true
                 }
                 R.id.notification_delete -> {
@@ -189,8 +190,9 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
                         withContext(Dispatchers.IO) {
                             euiccChannel.lpa.deleteNotification(notification.inner.seqNumber)
                         }
+
+                        refresh()
                     }
-                    refresh()
                     true
                 }
                 else -> false