refactor: move pwa/build-info -> appConfig (#1508)
This commit is contained in:
parent
1c9004a731
commit
415d36ce32
15 changed files with 27 additions and 18 deletions
|
@ -35,5 +35,5 @@ export const teams: Team[] = [
|
|||
].sort(() => Math.random() - 0.5)
|
||||
|
||||
export function useBuildInfo() {
|
||||
return useRuntimeConfig().public.buildInfo as BuildInfo
|
||||
return useAppConfig().buildInfo as BuildInfo
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export function setupPageHeader() {
|
|||
|
||||
return titleTemplate
|
||||
},
|
||||
link: process.client && useRuntimeConfig().public.pwaEnabled
|
||||
link: process.client && useAppConfig().pwaEnabled
|
||||
? () => [{
|
||||
key: 'webmanifest',
|
||||
rel: 'manifest',
|
||||
|
|
|
@ -149,7 +149,7 @@ export async function loginTo(masto: ElkMasto, user: Overwrite<UserLogin, { acco
|
|||
const [me, pushSubscription] = await Promise.all([
|
||||
fetchAccountInfo(client, user.server),
|
||||
// if PWA is not enabled, don't get push subscription
|
||||
useRuntimeConfig().public.pwaEnabled
|
||||
useAppConfig().pwaEnabled
|
||||
// we get 404 response instead empty data
|
||||
? client.v1.webPushSubscriptions.fetch().catch(() => Promise.resolve(undefined))
|
||||
: Promise.resolve(undefined),
|
||||
|
@ -194,7 +194,7 @@ export async function removePushNotificationData(user: UserLogin, fromSWPushMana
|
|||
// clear push notification policy
|
||||
delete useLocalStorage<PushNotificationPolicy>(STORAGE_KEY_NOTIFICATION_POLICY, {}).value[acct]
|
||||
|
||||
const pwaEnabled = useRuntimeConfig().public.pwaEnabled
|
||||
const pwaEnabled = useAppConfig().pwaEnabled
|
||||
const pwa = useNuxtApp().$pwa
|
||||
const registrationError = pwa?.registrationError === true
|
||||
const unregister = pwaEnabled && !registrationError && pwa?.registrationError === true && fromSWPushManager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue