Skip to content

Commit

Permalink
chore: Fix build errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
artonge committed Aug 27, 2024
1 parent 8287b35 commit 6e7f0e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/stores/weatherModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const models = {

type ModelKeys = keyof typeof models

export type ModelInfo = {
key: ModelKeys
label: string
enabled: boolean
}

const defaultEnabledModels: ModelKeys[] = [
'meteofrance_arome_france_hd',
'meteofrance_seamless',
Expand All @@ -24,7 +30,7 @@ export const useWeatherModelsStore = defineStore('weatherModels', {
enabled: useLocalStorage('enabledModels', defaultEnabledModels),
}),
getters: {
models(): {key: ModelKeys, label: string, enabled: boolean}[] {
models(): ModelInfo[] {
return this.order
.map(key => ({
key,
Expand Down
8 changes: 5 additions & 3 deletions src/views/AboutView.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<script setup>
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import draggable from 'vuedraggable'
import SvgIcon from '@jamescoyle/vue-icon'
import { mdiArrowLeft } from '@mdi/js'
import { mdiRestore } from '@mdi/js';
import { useWeatherModelsStore } from "@/stores/weatherModels"
import { useWeatherModelsStore, type ModelInfo } from "@/stores/weatherModels"
const store = useWeatherModelsStore()
const { models } = storeToRefs(store)
let drag = false
</script>
<template>
<header>
Expand All @@ -22,7 +24,7 @@ const { models } = storeToRefs(store)
<h3>Models</h3>
<draggable
v-model="models"
@update:modelValue="(newlyOrderedModels) => store.setOrder(newlyOrderedModels.map(model => model.key))"
@update:modelValue="(newlyOrderedModels) => store.setOrder(newlyOrderedModels.map((model: ModelInfo) => model.key))"
group="people"
@start="drag=true"
@end="drag=false"
Expand Down

0 comments on commit 6e7f0e8

Please sign in to comment.