Skip to content

Commit

Permalink
fix(frontend): 알림 위젯 필터링이 작동하지 않을 수 있음
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Jan 11, 2024
1 parent 24ead85 commit cf9bf6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
### Client
- Enhance: 빌트인 테마를 설치하려고 할 때 오류 메시지 개선
- Fix: 장식 추가로 일부 태그를 추가할 수 없음
- Fix: 알림 위젯 필터링이 작동하지 않을 수 있음 #404

---

Expand Down
26 changes: 2 additions & 24 deletions packages/frontend/src/widgets/WidgetNotifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cf9bf6f

Please sign in to comment.