1
0
forked from mirror/misskey

fix: Make more than 10 announcements visible on Admin (#11720)

This commit is contained in:
atsuchan 2023-08-21 17:26:21 +09:00 committed by GitHub
parent e8ff281db0
commit 49fc4cce3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
</div> </div>
</MkFolder> </MkFolder>
<MkButton class="button" @click="more()">
<i class="ti ti-reload"></i>{{ i18n.ts.more }}
</MkButton>
</div> </div>
</MkSpacer> </MkSpacer>
</MkStickyContainer> </MkStickyContainer>
@ -124,6 +127,12 @@ async function save(announcement) {
} }
} }
function more() {
os.api('admin/announcements/list', { untilId: announcements.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcementResponse => {
announcements = announcements.concat(announcementResponse);
});
}
function refresh() { function refresh() {
os.api('admin/announcements/list').then(announcementResponse => { os.api('admin/announcements/list').then(announcementResponse => {
announcements = announcementResponse; announcements = announcementResponse;