feat: improved types (#2547)
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2547 Reviewed-by: konrad <k@knt.li>
This commit is contained in:
@ -86,7 +86,7 @@ export const useBaseStore = defineStore('base', () => {
|
||||
}
|
||||
|
||||
async function handleSetCurrentList(
|
||||
{list, forceUpdate = false}: {list: IList | null, forceUpdate: boolean},
|
||||
{list, forceUpdate = false}: {list: IList | null, forceUpdate?: boolean},
|
||||
) {
|
||||
if (list === null) {
|
||||
setCurrentList({})
|
||||
|
@ -1,12 +1,10 @@
|
||||
import type { StoreDefinition } from 'pinia'
|
||||
|
||||
export interface LoadingState {
|
||||
isLoading: boolean
|
||||
}
|
||||
|
||||
const LOADING_TIMEOUT = 100
|
||||
|
||||
export const setModuleLoading = <LoadingStore extends StoreDefinition<string, LoadingState>>(store: LoadingStore, loadFunc : ((isLoading: boolean) => void) | null = null) => {
|
||||
export const setModuleLoading = <Store extends LoadingState>(store: Store, loadFunc : ((isLoading: boolean) => void) | null = null) => {
|
||||
const timeout = setTimeout(() => {
|
||||
if (loadFunc === null) {
|
||||
store.isLoading = true
|
||||
|
@ -364,7 +364,7 @@ export const useKanbanStore = defineStore('kanban', {
|
||||
}
|
||||
},
|
||||
|
||||
async updateBucket(updatedBucketData: IBucket) {
|
||||
async updateBucket(updatedBucketData: Partial<IBucket>) {
|
||||
const cancel = setModuleLoading(this)
|
||||
|
||||
const bucketIndex = findIndexById(this.buckets, updatedBucketData.id)
|
||||
|
@ -180,7 +180,7 @@ export const useListStore = defineStore('list', () => {
|
||||
export function useList(listId: MaybeRef<IList['id']>) {
|
||||
const listService = shallowReactive(new ListService())
|
||||
const {loading: isLoading} = toRefs(listService)
|
||||
const list: ListModel = reactive(new ListModel())
|
||||
const list: IList = reactive(new ListModel())
|
||||
const {t} = useI18n({useScope: 'global'})
|
||||
|
||||
watch(
|
||||
|
Reference in New Issue
Block a user