feat: add date math for filters #1342
|
@ -115,11 +115,6 @@ function emitChanged() {
|
|||
})
|
||||
}
|
||||
|
||||
function inputChanged() {
|
||||
flatpickrRange.value = ''
|
||||
emitChanged()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => flatpickrRange.value,
|
||||
konrad marked this conversation as resolved
Outdated
|
||||
(newVal: string | null) => {
|
||||
dpschen
commented
Called here! Called here!
|
||||
|
@ -139,8 +134,8 @@ watch(
|
|||
emitChanged()
|
||||
},
|
||||
)
|
||||
watch(() => from.value, inputChanged)
|
||||
watch(() => to.value, inputChanged)
|
||||
watch(() => from.value, emitChanged)
|
||||
watch(() => to.value, emitChanged)
|
||||
|
||||
dpschen
commented
This is triggered three times! Once for each of these lines:
in the called function inputChanged of the watcher. This is triggered three times!
Once for each of these lines:
```js
from.value = fromDate
to.value = toDate
```
in the called function inputChanged of the watcher.
And then here again.
konrad
commented
mhh how can we fix this? Using a debounce to prevent it getting called three times if it changed all values at once? Or removing the watchers again? It looks like the tasks are only loaded once, not three times. Maybe that's already enough? mhh how can we fix this? Using a debounce to prevent it getting called three times if it changed all values at once? Or removing the watchers again?
It looks like the tasks are only loaded once, not three times. Maybe that's already enough?
|
||||
function setDateRange(range: string[] | null) {
|
||||
if (range === null) {
|
||||
|
|
Reference in New Issue
Why do we need to reset this every time?
I don't think we have to. I've checked and it looks like this doesn't really break anything so I've removed it. Lets us get rid of
inputChanged
.