mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Set delayed loading spinner and additional CSP headers
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
const { data, form }: { data: PageServerData; form: ActionData } = $props();
|
||||
|
||||
let sending = $state(false);
|
||||
let loadingDelay: number;
|
||||
</script>
|
||||
|
||||
<SuccessOrError success={form?.success} message={form?.message} />
|
||||
@@ -42,9 +43,10 @@
|
||||
method="POST"
|
||||
action="?/logout"
|
||||
use:enhance={() => {
|
||||
sending = true;
|
||||
loadingDelay = window.setTimeout(() => (sending = true), 500);
|
||||
return async ({ update }) => {
|
||||
await update();
|
||||
window.clearTimeout(loadingDelay);
|
||||
sending = false;
|
||||
};
|
||||
}}
|
||||
@@ -70,9 +72,10 @@
|
||||
method="POST"
|
||||
action="?/deleteAccount"
|
||||
use:enhance={() => {
|
||||
sending = true;
|
||||
loadingDelay = window.setTimeout(() => (sending = true), 500);
|
||||
return async ({ update }) => {
|
||||
await update();
|
||||
window.clearTimeout(loadingDelay);
|
||||
window.location.hash = "!";
|
||||
sending = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user