fix structuredclone

This commit is contained in:
kwaroran
2024-10-25 18:11:00 +09:00
parent b3fddb814e
commit 0f6246bef6
28 changed files with 114 additions and 104 deletions

View File

@@ -15,7 +15,7 @@ window.addEventListener("message", (event) => {
});
export async function shareRealmCardData():Promise<{ name: ArrayBuffer; data: ArrayBuffer; }> {
const char = structuredClone(getCurrentCharacter({snapshot:true})) as character
const char = safeStructuredClone(getCurrentCharacter({snapshot:true})) as character
const trimedName = char.name.replace(/[^a-zA-Z0-9]/g, '') || 'character';
const writer = new VirtualWriter()
const namebuf = new TextEncoder().encode(trimedName + '.png')