feat: improve store and model typing
This commit is contained in:
@ -76,24 +76,24 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, computed, watchEffect} from 'vue'
|
||||
import {ref, computed, watchEffect, type PropType} from 'vue'
|
||||
import {useStore} from 'vuex'
|
||||
|
||||
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
||||
import Dropdown from '@/components/misc/dropdown.vue'
|
||||
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
||||
import TaskSubscription from '@/components/misc/subscription.vue'
|
||||
import ListModel from '@/models/list'
|
||||
import type SubscriptionModel from '@/models/subscription'
|
||||
import type {IList} from '@/models/list'
|
||||
import type { ISubscription } from '@/models/subscription'
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: ListModel,
|
||||
type: Object as PropType<IList>,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const subscription = ref<SubscriptionModel | null>(null)
|
||||
const subscription = ref<ISubscription | null>(null)
|
||||
watchEffect(() => {
|
||||
subscription.value = props.list.subscription ?? null
|
||||
})
|
||||
|
@ -43,9 +43,9 @@ import ListService from '@/services/list'
|
||||
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
||||
|
||||
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||
import type ListModel from '@/models/list'
|
||||
|
||||
import BaseButton from '@/components/base/BaseButton.vue'
|
||||
import type { IList } from '@/models/list'
|
||||
|
||||
const background = ref<string | null>(null)
|
||||
const backgroundLoading = ref(false)
|
||||
@ -53,7 +53,7 @@ const blurHashUrl = ref('')
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Object as PropType<ListModel>,
|
||||
type: Object as PropType<IList>,
|
||||
required: true,
|
||||
},
|
||||
showArchived: {
|
||||
@ -86,7 +86,7 @@ async function loadBackground() {
|
||||
|
||||
const store = useStore()
|
||||
|
||||
function toggleFavoriteList(list: ListModel) {
|
||||
function toggleFavoriteList(list: IList) {
|
||||
// The favorites pseudo list is always favorite
|
||||
// Archived lists cannot be marked favorite
|
||||
if (list.id === -1 || list.isArchived) {
|
||||
|
Reference in New Issue
Block a user