Board: fix lint issues

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2022-04-19 00:15:12 +07:00
parent 34220fd2ad
commit 50a212193d
No known key found for this signature in database
GPG Key ID: 08C11FFC23177C87
3 changed files with 8 additions and 4 deletions

View File

@ -20,8 +20,12 @@
let dueDateEnabled = dueDate !== undefined
$: dueDate && (savedDueDate = dueDate)
function getEmptyDate (): CardDate {
return {_class: object.date?._class ?? board.class.CardDate}
}
function update () {
const date: CardDate = {}
const date: CardDate = getEmptyDate()
if (startDate !== undefined) date.startDate = startDate
if (dueDate !== undefined) date.dueDate = dueDate
client.update(object, {date})
@ -68,7 +72,7 @@
label={board.string.Remove}
size={'small'}
on:click={() => {
client.update(object, {date: {}})
client.update(object, {date: getEmptyDate()})
dispatch('close')
}}
/>

View File

@ -10,7 +10,7 @@
let isChecked = date?.isChecked
function update() {
if (isChecked === undefined) return
if (isChecked === undefined || date === undefined) return
client.update(value, { date: { ...date, isChecked } })
}

View File

@ -3,7 +3,7 @@
import ColorPresenter from './ColorPresenter.svelte'
export let value: CardLabel
export let size: 'small' | 'medium'
export let size: 'small' | 'medium' | 'large' = 'medium'
</script>