Fix duplicate in-app notifs

Assign tag to view using Notification ID, and check if the view tag already exists.
This commit is contained in:
Hafiz 2023-05-17 14:23:00 -04:00
parent 77d7726395
commit 1ec591ce4f

View file

@ -141,7 +141,11 @@ class NotificationsActivity : BaseActivity(), androidx.swiperefreshlayout.widget
}
if (item != null) {
binding.notificationItems.addView(item)
item.tag = it.id
if (binding.notificationItems.findViewWithTag<View>(it.id) == null) {
binding.notificationItems.addView(item)
}
}
}
}