From df924418a95e5ca2ff760c8b84fb00f0ceaffb25 Mon Sep 17 00:00:00 2001 From: Yiqun Zhang Date: Mon, 26 Feb 2024 16:46:43 +0800 Subject: [PATCH] :bug: Fixed the issue where duplicate md5 pasted items were not deleted (#392) --- .../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