From 36fe4d53c9996cad7cd9a7f95887696e5c172f28 Mon Sep 17 00:00:00 2001 From: ImoutoChan Date: Sun, 4 Feb 2024 18:13:40 +0400 Subject: [PATCH] Fix duplicates in TagsEditVM when clicking right mouse button on image tag --- CHANGELOG.md | 1 + .../ImoutoRebirth.Navigator/ViewModel/TagsEditVM.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43885d6c..552ce25a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Support WebP format in FullScreenPreview * Add splashscreen * Show notes in full screen preview +* Fix duplicates in TagsEditVM when clicking right mouse button on image tag ### Harpy * Add ability to download faved danbooru pictures through gelbooru diff --git a/Source/ImoutoRebirth.Navigator/ImoutoRebirth.Navigator/ViewModel/TagsEditVM.cs b/Source/ImoutoRebirth.Navigator/ImoutoRebirth.Navigator/ViewModel/TagsEditVM.cs index f1f12ce2..ff81a8d9 100644 --- a/Source/ImoutoRebirth.Navigator/ImoutoRebirth.Navigator/ViewModel/TagsEditVM.cs +++ b/Source/ImoutoRebirth.Navigator/ImoutoRebirth.Navigator/ViewModel/TagsEditVM.cs @@ -278,6 +278,10 @@ public void DraftAddTag(BindedTagVM tag) var value = tag.Tag.IsCounter ? "Counter:1" : null; var searchTagVm = new SearchTagVM(new SearchTag(tag.Tag, value)); + + if (SelectedTags.Any(x => x.Tag.Id == searchTagVm.Tag.Id && x.Value == searchTagVm.Value)) + return; + SelectedTags.Add(searchTagVm); }