aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2023-11-16 22:08:51 +0200
committerHenry Jameson <me@hjkos.com>2023-11-16 22:08:51 +0200
commitc216340001f1b019b58a075c173b78ff9f4dafa7 (patch)
tree58c06c04e5c72010ad17f357d39b269cbf5ecfdb /src
parentaf27e2ca7ba87bb9c4b74ea0adee252afd2caabf (diff)
use dispatch instead of commmit, fix bad copypasta
Diffstat (limited to 'src')
-rw-r--r--src/modules/notifications.js8
-rw-r--r--src/services/notification_utils/notification_utils.js6
2 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/notifications.js b/src/modules/notifications.js
index a3cf76ef..9bd38220 100644
--- a/src/modules/notifications.js
+++ b/src/modules/notifications.js
@@ -52,7 +52,7 @@ export const notifications = {
})
},
markSingleNotificationAsSeen (state, { id }) {
- const notification = find(state.data, n => n.id === id)
+ const notification = state.idStore[id]
if (notification) notification.seen = true
},
dismissNotification (state, { id }) {
@@ -60,7 +60,7 @@ export const notifications = {
delete state.idStore[id]
},
updateNotification (state, { id, updater }) {
- const notification = find(state.data, n => n.id === id)
+ const notification = state.idStore[id]
notification && updater(notification)
}
},
@@ -113,7 +113,7 @@ export const notifications = {
}
})
},
- notificationClicked ({ state, commit }, { id }) {
+ notificationClicked ({ state, dispatch }, { id }) {
const notification = state.idStore[id]
const { type, seen } = notification
@@ -124,7 +124,7 @@ export const notifications = {
case 'follow_request':
break
default:
- commit('markSingleNotificationAsSeen', { id })
+ dispatch('markSingleNotificationAsSeen', { id })
}
}
},
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index 675e744e..342fe6ef 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -82,7 +82,11 @@ export const unseenNotificationsFromStore = store =>
export const prepareNotificationObject = (notification, i18n) => {
if (cachedBadgeUrl === null) {
const favicon = FaviconService.getOriginalFavicons()[0]
- cachedBadgeUrl = favicon.favimg.href
+ if (!favicon) {
+ cachedBadgeUrl = 'about:blank'
+ } else {
+ cachedBadgeUrl = favicon.favimg.href
+ }
}
const notifObj = {