mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Show popups at client init
This commit is contained in:
parent
1b8b6a8dd0
commit
fdb6f9f185
1 changed files with 20 additions and 1 deletions
|
@ -36,7 +36,7 @@ import { version, ui, lang, host } from "@/config";
|
|||
import { applyTheme } from "@/scripts/theme";
|
||||
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
|
||||
import { i18n } from "@/i18n";
|
||||
import { confirm, alert, post, popup, toast } from "@/os";
|
||||
import { confirm, alert, post, popup, toast, api } from "@/os";
|
||||
import { stream } from "@/stream";
|
||||
import * as sound from "@/scripts/sound";
|
||||
import { $i, refreshAccount, login, updateAccount, signout } from "@/account";
|
||||
|
@ -272,6 +272,25 @@ function checkForSplash() {
|
|||
}
|
||||
}
|
||||
|
||||
if ($i) {
|
||||
api("announcements", { withUnreads: true })
|
||||
.then((announcements) => {
|
||||
console.log(announcements);
|
||||
announcements.forEach((announcement) => {
|
||||
if (announcement.showPopup && announcement.isRead === false)
|
||||
popup(
|
||||
defineAsyncComponent(
|
||||
() => import("@/components/MkAnnouncement.vue"),
|
||||
),
|
||||
{ announcement: announcement },
|
||||
{},
|
||||
"closed",
|
||||
);
|
||||
});
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
}
|
||||
|
||||
// NOTE: この処理は必ず↑のクライアント更新時処理より後に来ること(テーマ再構築のため)
|
||||
watch(
|
||||
defaultStore.reactiveState.darkMode,
|
||||
|
|
Loading…
Reference in a new issue