web/ProcessingQueue: prevent cobalt from being closed

if queue progress is not 0% or 100%
This commit is contained in:
wukko 2025-05-14 17:30:47 +06:00
parent 68554c5b53
commit e7a3ab81d2
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
import { t } from "$lib/i18n/translations";
import { onNavigate } from "$app/navigation";
import { beforeNavigate, onNavigate } from "$app/navigation";
import { clearFileStorage } from "$lib/storage/opfs";
@ -50,6 +50,12 @@
// clear old files from storage on first page load
clearFileStorage();
});
beforeNavigate((event) => {
if (event.type === "leave" && (totalProgress > 0 && totalProgress < 1)) {
event.cancel();
}
});
</script>
<div id="processing-queue" class:expanded={$queueVisible}>