refactored notifications into their own module separate from statuses (WIP)
This commit is contained in:
parent
fffa7a4f4a
commit
aad3225d25
10 changed files with 170 additions and 158 deletions
|
|
@ -7,7 +7,7 @@ const state = { failCreateNotif: false }
|
|||
|
||||
export const showDesktopNotification = (rootState, desktopNotificationOpts) => {
|
||||
if (!('Notification' in window && window.Notification.permission === 'granted')) return
|
||||
if (rootState.statuses.notifications.desktopNotificationSilence) { return }
|
||||
if (rootState.notifications.desktopNotificationSilence) { return }
|
||||
|
||||
if (isSWSupported()) {
|
||||
swDesktopNotification(desktopNotificationOpts)
|
||||
|
|
|
|||
|
|
@ -439,7 +439,6 @@ export const parseNotification = (data) => {
|
|||
output.type = mastoDict[data.type] || data.type
|
||||
output.seen = data.pleroma.is_seen
|
||||
output.status = isStatusNotification(output.type) ? parseStatus(data.status) : null
|
||||
output.action = output.status // TODO: Refactor, this is unneeded
|
||||
output.target = output.type !== 'move'
|
||||
? null
|
||||
: parseUser(data.target)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import FaviconService from 'src/services/favicon_service/favicon_service.js'
|
|||
|
||||
let cachedBadgeUrl = null
|
||||
|
||||
export const notificationsFromStore = store => store.state.statuses.notifications.data
|
||||
export const notificationsFromStore = store => store.state.notifications.data
|
||||
|
||||
export const visibleTypes = store => {
|
||||
const rootState = store.rootState || store.state
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
|
|||
const args = { credentials }
|
||||
const { getters } = store
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.notifications
|
||||
const timelineData = rootState.notifications
|
||||
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
||||
|
||||
args.includeTypes = mastoApiNotificationTypes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue