mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-24 07:06:26 +09:00
fix(frontend): 알림 위젯 필터링이 작동하지 않을 수 있음
This commit is contained in:
parent
24ead85f8f
commit
cf9bf6fa0f
@ -31,6 +31,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
|
||||
### Client
|
||||
- Enhance: 빌트인 테마를 설치하려고 할 때 오류 메시지 개선
|
||||
- Fix: 장식 추가로 일부 태그를 추가할 수 없음
|
||||
- Fix: 알림 위젯 필터링이 작동하지 않을 수 있음 #404
|
||||
|
||||
---
|
||||
|
||||
|
@ -8,28 +8,24 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #icon><i class="ti ti-bell"></i></template>
|
||||
<template #header>{{ i18n.ts.notifications }}</template>
|
||||
<template #func="{ buttonStyleClass }">
|
||||
<button v-tooltip="i18n.ts.filter" class="_button" :class="buttonStyleClass" @click="setFilter"><i class="ti ti-filter"></i></button>
|
||||
<button v-tooltip="i18n.ts.markAllAsRead" class="_button" :class="buttonStyleClass" @click="os.apiWithDialog('notifications/mark-all-as-read')"><i class="ti ti-check"></i></button>
|
||||
<button v-tooltip="i18n.ts.settings" class="_button" :class="buttonStyleClass" @click="configureNotification()"><i class="ti ti-settings"></i></button>
|
||||
</template>
|
||||
|
||||
<div>
|
||||
<XNotifications :includeTypes="includeTypes"/>
|
||||
<XNotifications :excludeTypes="widgetProps.excludeTypes"/>
|
||||
</div>
|
||||
</MkContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, ref } from 'vue';
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
|
||||
import { GetFormResultType } from '@/scripts/form.js';
|
||||
import MkContainer from '@/components/MkContainer.vue';
|
||||
import XNotifications from '@/components/MkNotifications.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { notificationTypes } from '@/const.js';
|
||||
|
||||
const includeTypes = ref<string[] | null>(null);
|
||||
|
||||
const name = 'notifications';
|
||||
|
||||
@ -72,24 +68,6 @@ const configureNotification = () => {
|
||||
}, 'closed');
|
||||
};
|
||||
|
||||
const setFilter = (ev) => {
|
||||
const typeItems = notificationTypes.map(t => ({
|
||||
text: i18n.t(`_notification._types.${t}`),
|
||||
active: includeTypes.value && includeTypes.value.includes(t),
|
||||
action: () => {
|
||||
includeTypes.value = [t];
|
||||
},
|
||||
}));
|
||||
const items = includeTypes.value != null ? [{
|
||||
icon: 'ti ti-x',
|
||||
text: i18n.ts.clear,
|
||||
action: () => {
|
||||
includeTypes.value = null;
|
||||
},
|
||||
}, null, ...typeItems] : typeItems;
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
};
|
||||
|
||||
defineExpose<WidgetComponentExpose>({
|
||||
name,
|
||||
configure,
|
||||
|
Loading…
Reference in New Issue
Block a user