Fix zoomDefault on count up

This commit is contained in:
ZXY101
2024-02-08 16:28:37 +02:00
parent 47228f2b96
commit b1c4029345
2 changed files with 7 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import type { Page } from '$lib/types';
import { afterUpdate, onMount } from 'svelte';
import { afterUpdate, onMount, onDestroy } from 'svelte';
import TextBoxes from './TextBoxes.svelte';
import { zoomDefault } from '$lib/panzoom';
@@ -11,6 +11,12 @@
onMount(() => {
zoomDefault();
return () => {
setTimeout(() => {
zoomDefault();
}, 10);
};
});
afterUpdate(() => {

View File

@@ -202,21 +202,6 @@
}
}
}
let shouldUpdate = false;
function handleUpdate() {
shouldUpdate = true;
}
$: volumeSettings.singlePageView && handleUpdate();
afterUpdate(() => {
if (shouldUpdate) {
shouldUpdate = false;
zoomDefault();
}
});
</script>
<svelte:window