fix(task): don't immediately re-trigger date change when nothing changed
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Resolves https://community.vikunja.io/t/reminder-duplication/76/21?u=kolaente
This commit is contained in:
parent
a8441c72b8
commit
13d63e34aa
@ -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()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user