From d3ab8f7171b55c3f985641dd50a0d7048b16719d Mon Sep 17 00:00:00 2001 From: Yiqun Zhang Date: Mon, 26 Feb 2024 16:44:45 +0800 Subject: [PATCH] :bug: Fixed the issue where duplicate md5 pasted items were not deleted --- .../kotlin/com/clipevery/ui/clip/ClipPreviewsView.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/com/clipevery/ui/clip/ClipPreviewsView.kt b/composeApp/src/commonMain/kotlin/com/clipevery/ui/clip/ClipPreviewsView.kt index 88a060131..076f8f66c 100644 --- a/composeApp/src/commonMain/kotlin/com/clipevery/ui/clip/ClipPreviewsView.kt +++ b/composeApp/src/commonMain/kotlin/com/clipevery/ui/clip/ClipPreviewsView.kt @@ -91,6 +91,17 @@ fun ClipPreviewsView() { } } } + + changes.deletions + changes.deletionRanges + + val iterator = rememberClipDataList.iterator() + while (iterator.hasNext()) { + val clipData = iterator.next() + if (clipDao.getClipData(clipData.id) == null) { + iterator.remove() + } + } } else -> { // types other than UpdatedResults are not changes -- ignore them