Skip to content

Commit ea1c69e

Browse files
committed
Fix all TS errors! #2
1 parent ee9ac30 commit ea1c69e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

web/src/ViewShortcutsMode.svelte

+15-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@
6666
function back() {
6767
$mode = { mode: "neighbourhood" };
6868
}
69+
70+
function prev() {
71+
if (state.state == "chose-road") {
72+
state.shortcutIndex!--;
73+
}
74+
}
75+
76+
function next() {
77+
if (state.state == "chose-road") {
78+
state.shortcutIndex =
79+
state.shortcutIndex == null ? 0 : state.shortcutIndex + 1;
80+
}
81+
}
6982
</script>
7083

7184
<svelte:window on:keydown={onKeyDown} />
@@ -80,14 +93,14 @@
8093
<div>
8194
<button
8295
disabled={state.shortcutIndex == null || state.shortcutIndex == 0}
83-
on:click={() => state.shortcutIndex--}
96+
on:click={prev}
8497
>
8598
Prev
8699
</button>
87100
{state.shortcutIndex} / {state.gj.features.length}
88101
<button
89102
disabled={state.shortcutIndex == state.gj.features.length - 1}
90-
on:click={() => state.shortcutIndex++}
103+
on:click={next}
91104
>
92105
Next
93106
</button>

web/src/edit/NeighbourhoodMode.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
} from "geojson";
88
import type { MapMouseEvent } from "maplibre-gl";
99
import { onDestroy } from "svelte";
10-
import { GeoJSON, SymbolLayer } from "svelte-maplibre";
10+
import { GeoJSON, SymbolLayer, type LayerClickInfo } from "svelte-maplibre";
1111
import { notNull, Popup } from "../common";
1212
import ManageSavefiles from "../ManageSavefiles.svelte";
1313
import RenderNeighbourhood from "../RenderNeighbourhood.svelte";
@@ -63,7 +63,7 @@
6363
$map!.getCanvas().style.cursor = "inherit";
6464
}
6565
66-
function deleteFilter(e) {
66+
function deleteFilter(e: CustomEvent<LayerClickInfo>) {
6767
let f = e.detail.features[0];
6868
$app!.deleteModalFilter(f.properties!.road);
6969
$mutationCounter++;

0 commit comments

Comments
 (0)