From c74233392503ac7d69c3f0e63cd8c1775914a447 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Wed, 28 Aug 2024 10:15:25 -0500 Subject: [PATCH] only load/pin history if items were copied --- client/src/composables/historyDragDrop.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/composables/historyDragDrop.ts b/client/src/composables/historyDragDrop.ts index 0ab2675d43a8..5d0bfe89bdbd 100644 --- a/client/src/composables/historyDragDrop.ts +++ b/client/src/composables/historyDragDrop.ts @@ -162,13 +162,16 @@ export function useHistoryDragDrop(targetHistoryId?: Ref | string, creat ); } - if (pinHistories && historyStore.pinnedHistories.length > 0) { - // pin the target history - historyStore.pinHistory(historyId); - // also pin the original history where the item came from - historyStore.pinHistory(originalHistoryId); - } else { - historyStore.loadHistoryById(historyId); + // if items were copied + if (datasetCount > 0 && collectionCount > 0) { + if (pinHistories && historyStore.pinnedHistories.length > 0) { + // pin the target history + historyStore.pinHistory(historyId); + // also pin the original history where the item came from + historyStore.pinHistory(originalHistoryId); + } else { + historyStore.loadHistoryById(historyId); + } } } catch (error) { Toast.error(`${error}`);