浏览代码

Add settings for filtering end-of-poll notifications

Ref: poll-notif
Tusooa Zhu 2 年之前
父节点
当前提交
a35daceb5b

+ 9 - 0
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>

+ 5 - 0
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>

+ 2 - 1
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: [],

+ 1 - 1
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(_ => _))
 }