Skip to content

Commit

Permalink
Merge pull request #231 from GeekGene/fix/notifications-count-only-grows
Browse files Browse the repository at this point in the history
fix(ui): cached notificationsCount should only grow over time
  • Loading branch information
mattyg authored Sep 11, 2023
2 parents 199cac1 + 014399b commit a9bbb0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/src/stores/notificationsRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { StateTree, defineStore } from "pinia";
import { computed, ref } from "vue";
import { Notification } from "@/types/types";
import { encode, decode } from "@msgpack/msgpack";
import { PersistedStateOptions } from "pinia-plugin-persistedstate";

const notificationToKey = (notification: Notification) => {
const keyObj = {
Expand Down Expand Up @@ -53,7 +52,9 @@ export const makeUseNotificationsReadStore = (client: AppAgentClient) =>
}

function setNotificationsCount(count: number) {
notificationsCount.value = count;
if (count > notificationsCount.value) {
notificationsCount.value = count;
}
}

return {
Expand Down

0 comments on commit a9bbb0f

Please sign in to comment.