This repository was archived by the owner on May 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/main/java/com/keylesspalace/tusky/components/notifications Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import com.keylesspalace.tusky.settings.PrefKeys
4141import com.keylesspalace.tusky.usecase.TimelineCases
4242import com.keylesspalace.tusky.util.StatusDisplayOptions
4343import com.keylesspalace.tusky.util.deserialize
44+ import com.keylesspalace.tusky.util.isLessThan
4445import com.keylesspalace.tusky.util.serialize
4546import com.keylesspalace.tusky.util.throttleFirst
4647import com.keylesspalace.tusky.util.toViewData
@@ -567,7 +568,7 @@ class NotificationsViewModel @Inject constructor(
567568
568569 val highestNotificationId = trackerArray[statusId]
569570
570- return if (highestNotificationId == null || isEqualOrNewer (notificationId, highestNotificationId )) {
571+ return if (highestNotificationId == null || highestNotificationId.isLessThan (notificationId)) {
571572 trackerArray[statusId] = notificationId
572573
573574 true
@@ -580,19 +581,6 @@ class NotificationsViewModel @Inject constructor(
580581 }
581582 }
582583
583- /* *
584- * NOTE this currently assumes that the ids are integers. Can that change? If it does all notifications are unequal.
585- */
586- fun isEqualOrNewer (thisId : String , idToCompare : String ): Boolean {
587- try {
588- return thisId.toInt() >= idToCompare.toInt()
589- } catch (exc: NumberFormatException ) {
590- Log .e(TAG , " Cannot compare ids; not numbers: " + thisId+ " /" + idToCompare)
591-
592- return false
593- }
594- }
595-
596584 /* *
597585 * @return Flow of relevant preferences that change the UI
598586 */
You can’t perform that action at this time.
0 commit comments