お知らせの固定表示 (#5887)

* お知らせの固定

* ✌️

* Update index.home.vue

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
Xeltica
2020-02-09 21:31:17 +09:00
committed by GitHub
parent e78e5274d3
commit ac5453232f
5 changed files with 135 additions and 7 deletions

View File

@ -13,6 +13,11 @@ export const meta = {
default: 10
},
withUnreads: {
validator: $.optional.boolean,
default: false
},
sinceId: {
validator: $.optional.type(ID),
},
@ -38,5 +43,5 @@ export default define(meta, async (ps, user) => {
}
}
return announcements;
return ps.withUnreads ? announcements.filter((a: any) => !a.isRead) : announcements;
});