change announcements to be stack

This commit is contained in:
Beebles
2024-09-13 18:12:56 -06:00
parent 83ae98a709
commit 5a02f5fbe7
2 changed files with 19 additions and 21 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ export async function getStore(): Promise<Store> {
return await getSetting<Store>('store', Store.Default);
}
export async function getLatestAnnouncement(): Promise<Announcement | null> {
export async function getAnnouncements(): Promise<Announcement[]> {
let version = await window.DeckyPluginLoader.updateVersion();
let store = await getSetting<Store | null>('store', null);
let customURL = await getSetting<string>(
@@ -93,9 +93,9 @@ export async function getLatestAnnouncement(): Promise<Announcement | null> {
'X-Decky-Version': version.current,
},
});
if (res.status !== 200) return null;
if (res.status !== 200) return [];
const json = await res.json();
return json?.[0] ?? null;
return json ?? [];
}
export async function getPluginList(