Migrates to svelte 5
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { page } from "$app/stores";
|
||||
import { page } from "$app/state";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
export function formatTimeHHMM(minutes?: number) {
|
||||
@@ -17,7 +17,7 @@ export function formatDistance(meters?: number) {
|
||||
return "-";
|
||||
}
|
||||
|
||||
const unit = get(page).data.settings?.unit ?? "metric";
|
||||
const unit = page.data.settings?.unit ?? "metric";
|
||||
|
||||
if (unit == "metric") {
|
||||
if (meters >= 1000) {
|
||||
@@ -38,7 +38,7 @@ export function formatElevation(meters?: number) {
|
||||
return "-";
|
||||
}
|
||||
|
||||
const unit = get(page).data.settings?.unit ?? "metric";
|
||||
const unit = page.data.settings?.unit ?? "metric";
|
||||
|
||||
if (unit == "metric") {
|
||||
return `${Math.round(meters)} m`
|
||||
@@ -54,7 +54,7 @@ export function formatSpeed(speed?: number) {
|
||||
return "-";
|
||||
}
|
||||
|
||||
const unit = get(page).data.settings?.unit ?? "metric";
|
||||
const unit = page.data.settings?.unit ?? "metric";
|
||||
|
||||
if (unit == "metric") {
|
||||
return `${(speed * 3.6).toFixed(2)} km/h`
|
||||
|
||||
@@ -29,6 +29,7 @@ export class FontawesomeMarker extends M.Marker {
|
||||
|
||||
export function createMarkerFromWaypoint(waypoint: Waypoint, onDragEnd?: (marker: M.Marker, wpId?: string) => void): FontawesomeMarker {
|
||||
const marker = new FontawesomeMarker({
|
||||
id: waypoint.id,
|
||||
icon: `fa fa-${waypoint.icon}`,
|
||||
}, {
|
||||
draggable: onDragEnd !== undefined,
|
||||
|
||||
Reference in New Issue
Block a user