mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-12 23:30:58 +01:00
enhance: ダイアログのお知らせをアーカイブした時イベントが発生しないように・アーカイブされたお知らせをわかりやすく (MisskeyIO#153)
This commit is contained in:
parent
755d8419c9
commit
eaae8e6bea
2 changed files with 20 additions and 13 deletions
|
@ -98,6 +98,7 @@ export class AnnouncementService {
|
||||||
}
|
}
|
||||||
|
|
||||||
query.orderBy({
|
query.orderBy({
|
||||||
|
'announcement."isActive"': 'DESC',
|
||||||
'announcement."displayOrder"': 'DESC',
|
'announcement."displayOrder"': 'DESC',
|
||||||
'announcement."createdAt"': 'DESC',
|
'announcement."createdAt"': 'DESC',
|
||||||
});
|
});
|
||||||
|
@ -166,21 +167,26 @@ export class AnnouncementService {
|
||||||
|
|
||||||
const packed = await this.announcementEntityService.pack(
|
const packed = await this.announcementEntityService.pack(
|
||||||
announcement,
|
announcement,
|
||||||
values.userId ? { id: values.userId } : null,
|
announcement.userId ? { id: announcement.userId } : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (values.userId) {
|
if (announcement.isActive) {
|
||||||
this.globalEventService.publishMainStream(
|
if (announcement.userId) {
|
||||||
values.userId,
|
this.globalEventService.publishMainStream(
|
||||||
'announcementCreated',
|
announcement.userId,
|
||||||
{
|
'announcementCreated',
|
||||||
announcement: packed,
|
{
|
||||||
},
|
announcement: packed,
|
||||||
);
|
},
|
||||||
} else {
|
);
|
||||||
this.globalEventService.publishBroadcastStream('announcementCreated', {
|
} else {
|
||||||
announcement: packed,
|
this.globalEventService.publishBroadcastStream(
|
||||||
});
|
'announcementCreated',
|
||||||
|
{
|
||||||
|
announcement: packed,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -28,6 +28,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>
|
||||||
|
|
Loading…
Reference in a new issue