commit: a35daceb5ba96ba0f843ee405617fc043cd68f61
parent a4b6a97b1b96a15d5a74ae59e36eba7649ac8515
Author: Tusooa Zhu <tusooa@kazv.moe>
Date: Fri, 20 May 2022 16:41:45 -0400
Add settings for filtering end-of-poll notifications
Ref: poll-notif
Diffstat:
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue
@@ -61,6 +61,15 @@
:class="{ 'menu-checkbox-checked': filters.moves }"
/>{{ $t('settings.notification_visibility_moves') }}
</button>
+ <button
+ class="button-default dropdown-item"
+ @click="toggleNotificationFilter('polls')"
+ >
+ <span
+ class="menu-checkbox"
+ :class="{ 'menu-checkbox-checked': filters.polls }"
+ />{{ $t('settings.notification_visibility_polls') }}
+ </button>
</div>
</template>
<template v-slot:trigger>
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -41,6 +41,11 @@
{{ $t('settings.notification_visibility_emoji_reactions') }}
</BooleanSetting>
</li>
+ <li>
+ <BooleanSetting path="notificationVisibility.polls">
+ {{ $t('settings.notification_visibility_polls') }}
+ </BooleanSetting>
+ </li>
</ul>
</li>
</ul>
diff --git a/src/modules/config.js b/src/modules/config.js
@@ -54,7 +54,8 @@ export const defaultState = {
moves: true,
emojiReactions: true,
followRequest: true,
- chatMention: true
+ chatMention: true,
+ polls: true
},
webPushNotifications: false,
muteWords: [],
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
@@ -15,7 +15,7 @@ export const visibleTypes = store => {
rootState.config.notificationVisibility.followRequest && 'follow_request',
rootState.config.notificationVisibility.moves && 'move',
rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction',
- 'poll'
+ rootState.config.notificationVisibility.polls && 'poll'
].filter(_ => _))
}