fix(task): don't immediately re-trigger date change when nothing changed
continuous-integration/drone/push Build is passing Details

Resolves https://community.vikunja.io/t/reminder-duplication/76/21?u=kolaente
This commit is contained in:
kolaente 2024-01-10 23:27:14 +01:00
parent a8441c72b8
commit 13d63e34aa
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 5 deletions

View File

@ -128,6 +128,10 @@ const flatPickrDate = computed({
return
}
const oldDate = formatDate(date.value, 'yyy-LL-dd H:mm')
if (oldDate !== newValue) {
return
}
date.value = createDateFromString(newValue)
updateData()
},
@ -155,10 +159,6 @@ function updateData() {
}
function setDate(dateString: string) {
if (date.value === null) {
date.value = new Date()
}
const interval = calculateDayInterval(dateString)
const newDate = new Date()
newDate.setDate(newDate.getDate() + interval)
@ -166,7 +166,6 @@ function setDate(dateString: string) {
newDate.setMinutes(0)
newDate.setSeconds(0)
date.value = newDate
flatPickrDate.value = newDate
updateData()
}