mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-15 22:38:47 +00:00
heic2any를 동적으로 import하도록 변경
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import FileSaver from "file-saver";
|
||||
import heic2any from "heic2any";
|
||||
import { untrack } from "svelte";
|
||||
import type { Writable } from "svelte/store";
|
||||
import { TopBar } from "$lib/components";
|
||||
@@ -41,6 +40,7 @@
|
||||
requestFileDownload(data.id, $info.contentIv, $info.dataKey).then(async (res) => {
|
||||
content = new Blob([res], { type: $info.contentType });
|
||||
if (content.type === "image/heic" || content.type === "image/heif") {
|
||||
const { default: heic2any } = await import("heic2any");
|
||||
contentUrl = URL.createObjectURL(
|
||||
(await heic2any({ blob: content, toType: "image/jpeg" })) as Blob,
|
||||
);
|
||||
|
||||
@@ -2,8 +2,6 @@ import { error } from "@sveltejs/kit";
|
||||
import { z } from "zod";
|
||||
import type { PageLoad } from "./$types";
|
||||
|
||||
export const ssr = false; // Because of heic2any
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const zodRes = z
|
||||
.object({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { saveAs } from "file-saver";
|
||||
import FileSaver from "file-saver";
|
||||
import { goto } from "$app/navigation";
|
||||
import { Button, TextButton } from "$lib/components/buttons";
|
||||
import { TitleDiv, BottomDiv } from "$lib/components/divs";
|
||||
@@ -31,7 +31,7 @@
|
||||
const clientKeysBlob = new Blob([JSON.stringify(clientKeysSerialized)], {
|
||||
type: "application/json",
|
||||
});
|
||||
saveAs(clientKeysBlob, "arkvault-clientkey.json");
|
||||
FileSaver.saveAs(clientKeysBlob, "arkvault-clientkey.json");
|
||||
|
||||
if (!isBeforeContinueBottomSheetOpen) {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user