Migrate to svelte 5

This commit is contained in:
kwaroran
2024-10-23 02:31:37 +09:00
parent e434c7ab96
commit c7330719ad
120 changed files with 2398 additions and 2033 deletions

View File

@@ -1,9 +1,7 @@
import { get } from "svelte/store";
import { exportCharacterCard } from "./characterCards";
import { VirtualWriter, isTauri, openURL } from "./storage/globalApi";
import { sleep } from "./util";
import { CurrentCharacter } from "./stores";
import { DataBase, type character } from "./storage/database";
import { DataBase, getCurrentCharacter, type character } from "./storage/database";
import { alertStore } from "./alert";
let pong = false;
@@ -17,7 +15,7 @@ window.addEventListener("message", (event) => {
});
export async function shareRealmCardData():Promise<{ name: ArrayBuffer; data: ArrayBuffer; }> {
const char = structuredClone(get(CurrentCharacter)) as character
const char = structuredClone(getCurrentCharacter()) as character
const trimedName = char.name.replace(/[^a-zA-Z0-9]/g, '') || 'character';
const writer = new VirtualWriter()
const namebuf = new TextEncoder().encode(trimedName + '.png')