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}`);