Fix possible type error
This commit is contained in:
parent
9d931d1835
commit
a4db8b5293
|
@ -1,10 +1,10 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { detailMap } from "$lib/scripts/serviceMap";
|
import { detailMap, defaultVal } from "$lib/scripts/serviceMap";
|
||||||
import type { ServiceData } from "$lib/types/serviceData";
|
import type { ServiceData } from "$lib/types/serviceData";
|
||||||
|
|
||||||
export let detail: string
|
export let detail: string
|
||||||
|
|
||||||
const service: ServiceData = detailMap.get(detail)
|
const service: ServiceData = detailMap.get(detail) || defaultVal
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
import type { ServiceData } from "$lib/types/serviceData"
|
import type { ServiceData } from "$lib/types/serviceData"
|
||||||
|
|
||||||
|
export const defaultVal: ServiceData = {
|
||||||
|
formattedName: "",
|
||||||
|
url: "",
|
||||||
|
checkString: "",
|
||||||
|
description: "",
|
||||||
|
imgPath: "",
|
||||||
|
loginMethod: "",
|
||||||
|
}
|
||||||
|
|
||||||
export const detailMap = new Map <string, ServiceData>([
|
export const detailMap = new Map <string, ServiceData>([
|
||||||
["nextcloud", {
|
["nextcloud", {
|
||||||
formattedName: "Nextcloud",
|
formattedName: "Nextcloud",
|
||||||
|
|
Loading…
Reference in New Issue