From b6a01b48286aec3890c7c414cb658d9969653f3f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 6 Oct 2024 07:21:36 +0000 Subject: [PATCH] fix: avoid parsing twice --- .../components/smartsheet/details/Fields.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/details/Fields.vue b/packages/nc-gui/components/smartsheet/details/Fields.vue index 48e9128fc5..e3c9c6851f 100644 --- a/packages/nc-gui/components/smartsheet/details/Fields.vue +++ b/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) {