Merge branch 'develop' of https://codeberg.org/calckey/calckey into upstream/develop

This commit is contained in:
freeplay 2023-06-24 15:03:27 -04:00
commit 0b2a84d805
1 changed files with 18 additions and 13 deletions

View File

@ -12,8 +12,9 @@ import "@phosphor-icons/web/fill";
//#region account indexedDB migration //#region account indexedDB migration
import { set } from "@/scripts/idb-proxy"; import { set } from "@/scripts/idb-proxy";
if (localStorage.getItem("accounts") != null) { const accounts = localStorage.getItem("accounts")
set("accounts", JSON.parse(localStorage.getItem("accounts"))); if (accounts) {
set("accounts", JSON.parse(accounts));
localStorage.removeItem("accounts"); localStorage.removeItem("accounts");
} }
//#endregion //#endregion
@ -50,6 +51,18 @@ import { reactionPicker } from "@/scripts/reaction-picker";
import { getUrlWithoutLoginId } from "@/scripts/login-id"; import { getUrlWithoutLoginId } from "@/scripts/login-id";
import { getAccountFromId } from "@/scripts/get-account-from-id"; import { getAccountFromId } from "@/scripts/get-account-from-id";
function checkForSplash() {
const splash = document.getElementById("splash");
// 念のためnullチェック(HTMLが古い場合があるため(そのうち消す))
if (splash) {
splash.style.opacity = "0";
splash.style.pointerEvents = "none";
splash.addEventListener("transitionend", () => {
splash.remove();
});
}
}
(async () => { (async () => {
console.info(`Calckey v${version}`); console.info(`Calckey v${version}`);
@ -105,7 +118,7 @@ import { getAccountFromId } from "@/scripts/get-account-from-id";
//#region Set lang attr //#region Set lang attr
const html = document.documentElement; const html = document.documentElement;
html.setAttribute("lang", lang); html.setAttribute("lang", lang || "en-US");
//#endregion //#endregion
//#region loginId //#region loginId
@ -198,12 +211,7 @@ import { getAccountFromId } from "@/scripts/get-account-from-id";
directives(app); directives(app);
components(app); components(app);
const splash = document.getElementById("splash"); checkForSplash();
// 念のためnullチェック(HTMLが古い場合があるため(そのうち消す))
if (splash)
splash.addEventListener("transitionend", () => {
splash.remove();
});
// https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210 // https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210
// なぜかinit.tsの内容が2回実行されることがあるため、mountするdivを1つに制限する // なぜかinit.tsの内容が2回実行されることがあるため、mountするdivを1つに制限する
@ -231,10 +239,7 @@ import { getAccountFromId } from "@/scripts/get-account-from-id";
reactionPicker.init(); reactionPicker.init();
if (splash) { checkForSplash();
splash.style.opacity = "0";
splash.style.pointerEvents = "none";
}
// クライアントが更新されたか? // クライアントが更新されたか?
const lastVersion = localStorage.getItem("lastVersion"); const lastVersion = localStorage.getItem("lastVersion");