From 8db4524c2620ccb40fd1c8ba037998a94cb9d890 Mon Sep 17 00:00:00 2001
From: secondl1ght
Date: Sun, 10 Dec 2023 13:31:20 -0700
Subject: [PATCH] use svelte preventdefault handlers
---
src/lib/types.ts | 4 ----
src/routes/add-location/+page.svelte | 9 +++++----
src/routes/communities/add/+page.svelte | 9 +++++----
src/routes/verify-location/+page.svelte | 10 ++++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/lib/types.ts b/src/lib/types.ts
index c1071baf..5603a755 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -212,7 +212,3 @@ export type Theme = 'light' | 'dark';
export type DonationType = 'On-chain' | 'Lightning';
export type DropdownLink = { url: string; external?: boolean; icon: string; title: string };
-
-export type SubmitForm = SubmitEvent & {
- currentTarget: EventTarget & HTMLFormElement;
-};
diff --git a/src/routes/add-location/+page.svelte b/src/routes/add-location/+page.svelte
index e17c44f6..1961f96f 100644
--- a/src/routes/add-location/+page.svelte
+++ b/src/routes/add-location/+page.svelte
@@ -11,7 +11,6 @@
} from '$lib/comp';
import { attribution, changeDefaultIcons, geolocate, toggleMapButtons } from '$lib/map/setup';
import { areaError, areas, socials, theme } from '$lib/store';
- import type { SubmitForm } from '$lib/types';
import { detectTheme, errToast } from '$lib/utils';
// @ts-expect-error
import rewind from '@mapbox/geojson-rewind';
@@ -87,8 +86,7 @@
$: latFixed = lat && lat.toFixed(5);
$: longFixed = long && long.toFixed(5);
- const submitForm = (e: SubmitForm) => {
- e.preventDefault();
+ const submitForm = () => {
if (!selected) {
noLocationSelected = true;
errToast('Please select a location...');
@@ -384,7 +382,10 @@
/>
-