Browse Source

fix: avoid parsing twice

pull/9499/head
Pranav C 2 months ago
parent
commit
b6a01b4828
  1. 15
      packages/nc-gui/components/smartsheet/details/Fields.vue

15
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -357,10 +357,13 @@ const onFieldUpdate = (state: TableExplorerColumn, skipLinkChecks = false) => {
newFields.value = newFields.value.map((op) => {
if (compareCols(op, state)) {
ops.value = ops.value.filter((op) => op.op === 'add' && !compareCols(op.column, state))
ops.value.push({
op: 'add',
column: state,
})
ops.value = [
...ops.value,
{
op: 'add',
column: state,
},
]
return state
}
return op
@ -439,10 +442,10 @@ const onFieldAdd = (state: TableExplorerColumn) => {
state.temp_id = `temp_${++temporaryAddCount.value}`
state.view_id = view.value?.id as string
ops.value.push({
ops.value = [...ops.value, {
op: 'add',
column: state,
})
}]
newFields.value = [...newFields.value, state]
if (addFieldMoveHook.value) {

Loading…
Cancel
Save