Skip to content

Commit 870f3c3

Browse files
committed
chore: handle location err
1 parent dc5a3b6 commit 870f3c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/DeviceLocation.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const DeviceLocation: VoidComponent<{ device: Device; deviceName: string }> = (p
109109
} else if (foundLocations.length === 1) {
110110
args.map.setView([foundLocations[0].lat, foundLocations[0].lng], 15)
111111
} else {
112-
throw new Error('Location unavailable')
112+
throw new Error('Offline')
113113
}
114114

115115
return foundLocations
@@ -159,7 +159,7 @@ const DeviceLocation: VoidComponent<{ device: Device; deviceName: string }> = (p
159159
title="Show your current location"
160160
color="secondary"
161161
class="bg-surface-container-low text-on-surface-variant"
162-
onClick={() => void requestLocation().catch(() => null)}
162+
onClick={() => void requestLocation()}
163163
trailing={<span class="pr-2 text-sm">Show my location</span>}
164164
>
165165
<Icon size="20">my_location</Icon>

0 commit comments

Comments
 (0)