Browse Source

fix: avoid adding undo if delete fails

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5884/head
mertmit 1 year ago
parent
commit
4deb2a1f0b
  1. 10
      packages/nc-gui/composables/useViewData.ts

10
packages/nc-gui/composables/useViewData.ts

@ -611,6 +611,11 @@ export function useViewData(
.map((c) => row.row[c.title!])
.join('___')
const deleted = await deleteRowById(id as string)
if (!deleted) {
return
}
if (!undo) {
addUndo({
redo: {
@ -648,11 +653,6 @@ export function useViewData(
scope: defineViewScope({ view: viewMeta.value }),
})
}
const deleted = await deleteRowById(id as string)
if (!deleted) {
return
}
}
formattedData.value.splice(rowIndex, 1)

Loading…
Cancel
Save