diff --git a/packages/nc-gui-v2/composables/useSmartsheetRowStore.ts b/packages/nc-gui-v2/composables/useSmartsheetRowStore.ts index 8bb3135a89..de2987577e 100644 --- a/packages/nc-gui-v2/composables/useSmartsheetRowStore.ts +++ b/packages/nc-gui-v2/composables/useSmartsheetRowStore.ts @@ -5,7 +5,7 @@ import type { Ref } from 'vue' import type { Row } from './useViewData' import { useInjectionState, useMetas, useNuxtApp, useProject, useVirtualCell } from '#imports' import { NOCO } from '~/lib' -import { extractPkFromRow, extractSdkResponseErrorMsg } from '~/utils' +import { deepCompare, extractPkFromRow, extractSdkResponseErrorMsg } from '~/utils' const [useProvideSmartsheetRowStore, useSmartsheetRowStore] = useInjectionState((meta: Ref, row: Ref) => { const { $api } = useNuxtApp() @@ -23,6 +23,11 @@ const [useProvideSmartsheetRowStore, useSmartsheetRowStore] = useInjectionState( const { isHm, isMm, isBt } = $(useVirtualCell(ref(column))) if (isHm || isMm) { state.value[column.title!] = state.value[column.title!] || [] + + if (state.value[column.title!]!.find((ln: Record) => deepCompare(ln, value))) { + return message.info('This value is already in the list') + } + state.value[column.title!]!.push(value) } else if (isBt) { state.value[column.title!] = value