2023-11-26 21:27:02 +01:00
|
|
|
import { reactive } from "vue";
|
2023-12-05 08:12:33 +01:00
|
|
|
import type { Account } from "@/account";
|
2023-10-22 23:29:46 +02:00
|
|
|
|
|
|
|
const accountData = localStorage.getItem("account");
|
|
|
|
|
|
|
|
// TODO: 外部からはreadonlyに
|
|
|
|
export const $i = accountData
|
|
|
|
? reactive(JSON.parse(accountData) as Account)
|
|
|
|
: null;
|
2024-01-11 02:21:21 +01:00
|
|
|
|
|
|
|
export const isSignedIn = $i != null;
|
|
|
|
export const isModerator = $i != null && ($i.isModerator || $i.isAdmin);
|
2024-02-20 09:39:32 +01:00
|
|
|
export const isEmojiMod = isModerator || $i?.emojiModPerm !== "unauthorized";
|
|
|
|
export const isAdmin = $i?.isAdmin;
|