(change): Workflow improvements and force reloads on navigate

This commit is contained in:
2026-06-27 22:43:17 -04:00
parent 9602ed52a6
commit ff9265645c
7 changed files with 18 additions and 56 deletions
@@ -1,6 +1,5 @@
<script>
import { resolve } from '$app/paths';
import { afterNavigate, beforeNavigate } from '$app/navigation';
import { browser } from '$app/environment';
import { bS, bAS, iS, rBS } from '$lib/client/styles';
import HeaderBar from '$lib/client/components/HeaderBar.svelte';
@@ -82,7 +81,7 @@
}
},
prevLine: () => {
if (items[prevIdx]) {
if (curIdx > 0) {
setTimeout(() => {
focusIdx(prevIdx);
}, 1);
@@ -130,19 +129,6 @@
};
const headers = ['Basket ID', 'Description', 'Donors', 'Save?'];
beforeNavigate(({ cancel }) => {
if (itemsBuffer.length > 0) {
if (!confirm('Are you sure you want to leave this page? There are unsaved changes!'))
cancel();
}
});
afterNavigate(() => {
items = [];
pager = { idFrom: 0, idTo: 0 };
curIdx = 0;
});
if (browser) {
window.addEventListener('beforeunload', (e) => {
if (itemsBuffer.length > 0) e.preventDefault();