From ea41cc6ec0f7b79fc753d37b4586abfef87bf23f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 4 Jan 2024 15:30:40 +0900 Subject: refactor(frontend): reduce type errors --- packages/frontend/src/pages/settings/notifications.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'packages/frontend/src/pages/settings/notifications.vue') diff --git a/packages/frontend/src/pages/settings/notifications.vue b/packages/frontend/src/pages/settings/notifications.vue index 98b82f7116..1e9515e588 100644 --- a/packages/frontend/src/pages/settings/notifications.vue +++ b/packages/frontend/src/pages/settings/notifications.vue @@ -62,12 +62,14 @@ import FormSection from '@/components/form/section.vue'; import MkFolder from '@/components/MkFolder.vue'; import MkSwitch from '@/components/MkSwitch.vue'; import * as os from '@/os.js'; -import { $i } from '@/account.js'; +import { signinRequired } from '@/account.js'; import { i18n } from '@/i18n.js'; import { definePageMetadata } from '@/scripts/page-metadata.js'; import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue'; import { notificationTypes } from '@/const.js'; +const $i = signinRequired(); + const nonConfigurableNotificationTypes = ['note', 'roleAssigned', 'followRequestAccepted', 'achievementEarned']; const allowButton = shallowRef>(); @@ -86,11 +88,11 @@ async function readAllNotifications() { async function updateReceiveConfig(type, value) { await os.apiWithDialog('i/update', { notificationRecieveConfig: { - ...$i!.notificationRecieveConfig, + ...$i.notificationRecieveConfig, [type]: value, }, }).then(i => { - $i!.notificationRecieveConfig = i.notificationRecieveConfig; + $i.notificationRecieveConfig = i.notificationRecieveConfig; }); } -- cgit v1.2.3-freya