mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
20 lines
501 B
Svelte
20 lines
501 B
Svelte
<script lang="ts">
|
|
import { getDownloadingFiles, getUploadingFiles } from "#lib/client/transfer/index.js";
|
|
import { Toasts } from "#lib/ui/index.js";
|
|
import "../app.css";
|
|
|
|
let { children } = $props();
|
|
|
|
const protectFileUploadAndDownload = (e: BeforeUnloadEvent) => {
|
|
if (getDownloadingFiles().length > 0 || getUploadingFiles().length > 0) {
|
|
e.preventDefault();
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<svelte:window onbeforeunload={protectFileUploadAndDownload} />
|
|
|
|
{@render children()}
|
|
|
|
<Toasts />
|