fix build
This commit is contained in:
parent
4bba716409
commit
3741d8df72
2 changed files with 4 additions and 5 deletions
|
|
@ -36,6 +36,7 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j
|
|||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useNotificationsStore } from 'src/stores/notifications.js'
|
||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||
import { useStatusesStore } from 'src/stores/statuses.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
|
@ -543,7 +544,7 @@ const afterStoreSetup = async ({ pinia, store, storageError, i18n }) => {
|
|||
window.highlightConfig = useUserHighlightStore()
|
||||
|
||||
FaviconService.initFaviconService()
|
||||
initServiceWorker()
|
||||
initServiceWorker(useNotificationsStore())
|
||||
|
||||
window.addEventListener('focus', () => updateFocus())
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import { useNotificationsStore } from 'src/stores/notifications.js'
|
||||
|
||||
/* global process */
|
||||
function urlBase64ToUint8Array(base64String) {
|
||||
const padding = '='.repeat((4 - (base64String.length % 4)) % 4)
|
||||
|
|
@ -96,7 +94,7 @@ function sendSubscriptionToBackEnd(
|
|||
return responseData
|
||||
})
|
||||
}
|
||||
export async function initServiceWorker() {
|
||||
export async function initServiceWorker(notificationsStore) {
|
||||
if (!isSWSupported()) return
|
||||
await getOrCreateServiceWorker()
|
||||
navigator.serviceWorker.addEventListener('message', (event) => {
|
||||
|
|
@ -104,7 +102,7 @@ export async function initServiceWorker() {
|
|||
|
||||
switch (type) {
|
||||
case 'notificationClicked':
|
||||
useNotificationsStore().notificationClicked(rest.id)
|
||||
notificationsStore.notificationClicked(rest.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue