Skip to content

Commit

Permalink
Added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikgeissler committed Nov 11, 2023
1 parent 6f611ed commit aac3360
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { microcopy } from './stores'
import type { Link } from './types'
const icon_map: Record<string, string> = $microcopy?.icons?.pages?.footer
const icon_map: Record<string, string> = $microcopy?.icons?.pages?.footer ?? []
export let links: Link[]
export let social: Record<keyof typeof icon_map, string>
Expand Down
1 change: 1 addition & 0 deletions src/lib/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
export let map: mapboxgl.Map | null = null
export let markers: MapMarker[] = []
// Default values are the german options
export const { lng, lat, zoom, minZoom, maxZoom } = $microcopy?.map?.location ?? [
10, 51.3, 5.05, 4, 10,
]
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let nav: NavLink[]
export let mobile: boolean
const icon_map: Record<string, string> = $microcopy?.icons?.pages?.nav
const icon_map: Record<string, string> = $microcopy?.icons?.pages?.nav ?? {}
let isOpen = false
let activeSubNav = -1
Expand Down
2 changes: 1 addition & 1 deletion src/lib/TagList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const tagOccurrences = Object.entries(tagCounter) as [string, number][]
const icons: Record<string, string> = $microcopy?.icons?.tags?.blog
const icons: Record<string, string> = $microcopy?.icons?.tags?.blog ?? {}
let open = false
let viewWidth: number
const style = `height: 18pt; margin-right: 5pt;`
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ThemeSwitcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
system: `dark`,
} as const
const color_mode_icons = $microcopy?.icons?.global?.theme
const color_mode_icons = $microcopy?.icons?.global?.theme ?? {}
function set_color_mode() {
const next = next_color_mode[$colorMode]
Expand Down
2 changes: 1 addition & 1 deletion src/routes/faq/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let data
const icons: Record<string, string> = $microcopy?.icons?.tags?.faq
const icons: Record<string, string> = $microcopy?.icons?.tags?.faq ?? {}
let active_tag = `Alle`
const email = `info@${$microcopy?.location?.url}`
Expand Down
2 changes: 1 addition & 1 deletion src/routes/lernmaterial/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let data
const icon_map: Record<string, string> = $microcopy?.icons?.tags?.faq
const icon_map: Record<string, string> = $microcopy?.icons?.tags?.faq ?? {}
let active_tag = `Alle`
const email = `it@${$microcopy?.location?.url}`
Expand Down

0 comments on commit aac3360

Please sign in to comment.