enhance: ダイアログのお知らせをアーカイブした時イベントが発生しないように・アーカイブされたお知らせをわかりやすく (MisskeyIO#153)

This commit is contained in:
まっちゃとーにゅ 2023-08-20 05:47:09 +09:00 committed by NoriDev
parent e649651b45
commit 3996b61420
2 changed files with 11 additions and 8 deletions

View file

@ -75,14 +75,16 @@ export class AnnouncementService {
const packed = (await this.packMany([announcement]))[0]; const packed = (await this.packMany([announcement]))[0];
if (values.userId) { if (announcement.isActive) {
this.globalEventService.publishMainStream(values.userId, 'announcementCreated', { if (announcement.userId) {
announcement: packed, this.globalEventService.publishMainStream(announcement.userId, 'announcementCreated', {
}); announcement: packed,
} else { });
this.globalEventService.publishBroadcastStream('announcementCreated', { } else {
announcement: packed, this.globalEventService.publishBroadcastStream('announcementCreated', {
}); announcement: packed,
});
}
} }
return { return {

View file

@ -13,6 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder v-for="announcement in announcements" :key="announcement.id ?? announcement._id" :defaultOpen="announcement.id == null"> <MkFolder v-for="announcement in announcements" :key="announcement.id ?? announcement._id" :defaultOpen="announcement.id == null">
<template #label>{{ announcement.title }}</template> <template #label>{{ announcement.title }}</template>
<template #icon> <template #icon>
<i v-if="announcement.id && !announcement.isActive" class="ti ti-archive"></i>
<i v-if="announcement.icon === 'info'" class="ti ti-info-circle"></i> <i v-if="announcement.icon === 'info'" class="ti ti-info-circle"></i>
<i v-else-if="announcement.icon === 'warning'" class="ti ti-alert-triangle" style="color: var(--warn);"></i> <i v-else-if="announcement.icon === 'warning'" class="ti ti-alert-triangle" style="color: var(--warn);"></i>
<i v-else-if="announcement.icon === 'error'" class="ti ti-circle-x" style="color: var(--error);"></i> <i v-else-if="announcement.icon === 'error'" class="ti ti-circle-x" style="color: var(--error);"></i>