mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-29 13:00:12 +02:00
web/ProcessingQueue: prevent cobalt from being closed
if queue progress is not 0% or 100%
This commit is contained in:
parent
68554c5b53
commit
e7a3ab81d2
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import { t } from "$lib/i18n/translations";
|
import { t } from "$lib/i18n/translations";
|
||||||
import { onNavigate } from "$app/navigation";
|
import { beforeNavigate, onNavigate } from "$app/navigation";
|
||||||
|
|
||||||
import { clearFileStorage } from "$lib/storage/opfs";
|
import { clearFileStorage } from "$lib/storage/opfs";
|
||||||
|
|
||||||
@ -50,6 +50,12 @@
|
|||||||
// clear old files from storage on first page load
|
// clear old files from storage on first page load
|
||||||
clearFileStorage();
|
clearFileStorage();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
beforeNavigate((event) => {
|
||||||
|
if (event.type === "leave" && (totalProgress > 0 && totalProgress < 1)) {
|
||||||
|
event.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="processing-queue" class:expanded={$queueVisible}>
|
<div id="processing-queue" class:expanded={$queueVisible}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user