use dispatch instead of commmit, fix bad copypasta
This commit is contained in:
parent
af27e2ca7b
commit
c216340001
@ -52,7 +52,7 @@ export const notifications = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
markSingleNotificationAsSeen (state, { id }) {
|
markSingleNotificationAsSeen (state, { id }) {
|
||||||
const notification = find(state.data, n => n.id === id)
|
const notification = state.idStore[id]
|
||||||
if (notification) notification.seen = true
|
if (notification) notification.seen = true
|
||||||
},
|
},
|
||||||
dismissNotification (state, { id }) {
|
dismissNotification (state, { id }) {
|
||||||
@ -60,7 +60,7 @@ export const notifications = {
|
|||||||
delete state.idStore[id]
|
delete state.idStore[id]
|
||||||
},
|
},
|
||||||
updateNotification (state, { id, updater }) {
|
updateNotification (state, { id, updater }) {
|
||||||
const notification = find(state.data, n => n.id === id)
|
const notification = state.idStore[id]
|
||||||
notification && updater(notification)
|
notification && updater(notification)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -113,7 +113,7 @@ export const notifications = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
notificationClicked ({ state, commit }, { id }) {
|
notificationClicked ({ state, dispatch }, { id }) {
|
||||||
const notification = state.idStore[id]
|
const notification = state.idStore[id]
|
||||||
const { type, seen } = notification
|
const { type, seen } = notification
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ export const notifications = {
|
|||||||
case 'follow_request':
|
case 'follow_request':
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
commit('markSingleNotificationAsSeen', { id })
|
dispatch('markSingleNotificationAsSeen', { id })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -82,8 +82,12 @@ export const unseenNotificationsFromStore = store =>
|
|||||||
export const prepareNotificationObject = (notification, i18n) => {
|
export const prepareNotificationObject = (notification, i18n) => {
|
||||||
if (cachedBadgeUrl === null) {
|
if (cachedBadgeUrl === null) {
|
||||||
const favicon = FaviconService.getOriginalFavicons()[0]
|
const favicon = FaviconService.getOriginalFavicons()[0]
|
||||||
|
if (!favicon) {
|
||||||
|
cachedBadgeUrl = 'about:blank'
|
||||||
|
} else {
|
||||||
cachedBadgeUrl = favicon.favimg.href
|
cachedBadgeUrl = favicon.favimg.href
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const notifObj = {
|
const notifObj = {
|
||||||
tag: notification.id,
|
tag: notification.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user