aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/handler.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-31 15:23:49 -0700
committerAdam Soltys <[email protected]>2024-08-31 15:23:49 -0700
commita89d4ee9b9bf0c15505a58803585f1847731983e (patch)
tree46098814beabc79de334898dbc4808aed8d5f329 /src/lib/handler.ts
parentdf71664f20312e81134ee90ad561f55d3020ee0a (diff)
downloadcoinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.tar.gz
coinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.zip
typescript
Diffstat (limited to 'src/lib/handler.ts')
-rw-r--r--src/lib/handler.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/handler.ts b/src/lib/handler.ts
index 03795ad9..559761f0 100644
--- a/src/lib/handler.ts
+++ b/src/lib/handler.ts
@@ -1,14 +1,13 @@
import { goto } from "$app/navigation";
import { applyAction } from "$app/forms";
-export default (submitting) =>
- () => {
- submitting = true;
- return async ({ result }) => {
- if (result.type === "redirect") {
- goto(result.location);
- } else {
- await applyAction(result);
- }
- };
+export default (toggle) => () => {
+ toggle();
+ return async ({ result }) => {
+ if (result.type === "redirect") {
+ goto(result.location);
+ } else {
+ await applyAction(result);
+ }
};
+};