Browse Source

fix: wait until any previous filter is in saving state

pull/8752/head
Pranav C 2 weeks ago
parent
commit
cd0ff8e234
  1. 7
      packages/nc-gui/composables/useViewFilters.ts

7
packages/nc-gui/composables/useViewFilters.ts

@ -349,9 +349,12 @@ export function useViewFilters(
// if already in progress the debounced function which will call this function again with 500ms delay until it's not saving
if (savingStatus[i]) {
return saveOrUpdateDebounced(filter, i, force, undo, skipDataReload)
} else {
savingStatus[i] = true
}
// wait if any previous filter save is in progress, it's to avoid messing up the order of filters
else if (Array.from({ length: i }).some((_, index) => savingStatus[index])) {
return saveOrUpdateDebounced(filter, i, force, undo, skipDataReload)
}
savingStatus[i] = true
if (!view.value && !linkColId?.value) return

Loading…
Cancel
Save