π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): if pasted date is different that stored currentcopy data then remove it from localStorage
Ramesh Manec8e412aa23aa
diff --git a/packages/nc-gui/composables/useNcClipboardData.ts b/packages/nc-gui/composables/useNcClipboardData.tsindex e89ca06f25..c48f294d6c 100644--- a/packages/nc-gui/composables/useNcClipboardData.ts+++ b/packages/nc-gui/composables/useNcClipboardData.ts@@ -19,6 +19,12 @@ const useNcClipboardData = () => {const waitingCellClipboardDataIds = useStorage<string[]>(NcClipboardDataKey.ncWaitingClipboardDataIds, [])+ const resetCellClipboard = () => {+ cellClipboardData.value = {}+ currentCellClipboardDataId.value = ''+ waitingCellClipboardDataIds.value = []+ }+const getCurrentCopiedCellClipboardData = (clipboardData: string): NcClipboardDataItemType | null => {if (!currentCellClipboardDataId.value || !cellClipboardData.value?.[currentCellClipboardDataId.value]) {return null@@ -26,9 +32,21 @@ const useNcClipboardData = () => {const currentClipboardDataItem = cellClipboardData.value?.[currentCellClipboardDataId.value] as NcClipboardDataItemType- return currentClipboardDataItem?.copiedPlainText === clipboardData && currentClipboardDataItem.dbCellValueArr.length- ? currentClipboardDataItem- : null+ if (currentClipboardDataItem?.copiedPlainText === clipboardData && currentClipboardDataItem.dbCellValueArr.length) {+ return currentClipboardDataItem+ } else {+ // If pasted data is different from the copied data, then clear current clipboard data item+ waitingCellClipboardDataIds.value = waitingCellClipboardDataIds.value.filter(+ (id) => id !== currentCellClipboardDataId.value,+ )+ cellClipboardData.value = {+ ...extractProps(cellClipboardData.value, waitingCellClipboardDataIds.value),+ } as NcClipboardDataType++ currentCellClipboardDataId.value = ''++ return null+ }}const getClipboardItemId = (): string => {@@ -69,12 +87,6 @@ const useNcClipboardData = () => {}}- const resetCellClipboard = () => {- cellClipboardData.value = {}- currentCellClipboardDataId.value = ''- waitingCellClipboardDataIds.value = []- }-return {cellClipboardData,currentCellClipboardDataId,