summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/settings/notifications.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-10-20 17:29:41 +0900
committerGitHub <noreply@github.com>2024-10-20 17:29:41 +0900
commitd6caa4d9c4453cf38129197dd4a237711f0085ec (patch)
tree7d6bc36f7620f82623b2ab2d567e0b7b96bf2ba6 /packages/frontend/src/pages/settings/notifications.vue
parent:art: (diff)
downloadmisskey-d6caa4d9c4453cf38129197dd4a237711f0085ec.tar.gz
misskey-d6caa4d9c4453cf38129197dd4a237711f0085ec.tar.bz2
misskey-d6caa4d9c4453cf38129197dd4a237711f0085ec.zip
fix(frontend): 通知の範囲指定が必要ない通知設定でも範囲指定がでている問題を修正 (#14798)
* fix(frontend): 通知の範囲指定が必要ない通知設定でも範囲指定がでている問題を修正 * Update Changelog --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/pages/settings/notifications.vue')
-rw-r--r--packages/frontend/src/pages/settings/notifications.vue15
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/frontend/src/pages/settings/notifications.vue b/packages/frontend/src/pages/settings/notifications.vue
index 53b3bd4936..8ffe0d6a7a 100644
--- a/packages/frontend/src/pages/settings/notifications.vue
+++ b/packages/frontend/src/pages/settings/notifications.vue
@@ -22,7 +22,12 @@ SPDX-License-Identifier: AGPL-3.0-only
}}
</template>
- <XNotificationConfig :userLists="userLists" :value="$i.notificationRecieveConfig[type] ?? { type: 'all' }" @update="(res) => updateReceiveConfig(type, res)"/>
+ <XNotificationConfig
+ :userLists="userLists"
+ :value="$i.notificationRecieveConfig[type] ?? { type: 'all' }"
+ :configurableTypes="onlyOnOrOffNotificationTypes.includes(type) ? ['all', 'never'] : undefined"
+ @update="(res) => updateReceiveConfig(type, res)"
+ />
</MkFolder>
</div>
</FormSection>
@@ -58,7 +63,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { shallowRef, computed } from 'vue';
-import XNotificationConfig from './notifications.notification-config.vue';
+import XNotificationConfig, { type NotificationConfig } from './notifications.notification-config.vue';
import FormLink from '@/components/form/link.vue';
import FormSection from '@/components/form/section.vue';
import MkFolder from '@/components/MkFolder.vue';
@@ -73,7 +78,9 @@ import { notificationTypes } from '@@/js/const.js';
const $i = signinRequired();
-const nonConfigurableNotificationTypes = ['note', 'roleAssigned', 'followRequestAccepted', 'achievementEarned', 'test', 'exportCompleted'] as const satisfies (typeof notificationTypes[number])[];
+const nonConfigurableNotificationTypes = ['note', 'roleAssigned', 'followRequestAccepted', 'test', 'exportCompleted'] satisfies (typeof notificationTypes[number])[] as string[];
+
+const onlyOnOrOffNotificationTypes = ['app', 'achievementEarned', 'login'] satisfies (typeof notificationTypes[number])[] as string[];
const allowButton = shallowRef<InstanceType<typeof MkPushNotificationAllowButton>>();
const pushRegistrationInServer = computed(() => allowButton.value?.pushRegistrationInServer);
@@ -88,7 +95,7 @@ async function readAllNotifications() {
await os.apiWithDialog('notifications/mark-all-as-read');
}
-async function updateReceiveConfig(type, value) {
+async function updateReceiveConfig(type: typeof notificationTypes[number], value: NotificationConfig) {
await os.apiWithDialog('i/update', {
notificationRecieveConfig: {
...$i.notificationRecieveConfig,