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

Loading…
Cancel
Save