From 5e1948516d64b317dabe5b9b2b67b09537271f0d Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 12 Oct 2022 11:06:32 +1100 Subject: [PATCH] Fix phash match presentation (#2997) --- .../Tagger/scenes/StashSearchResult.tsx | 78 +++++++++++-------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx b/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx index ddc270b15..3feb34a2e 100755 --- a/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx +++ b/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx @@ -95,7 +95,13 @@ function matchPhashes( } }); - return matches; + // convert to tuple and sort by distance descending + const entries = Object.entries(matches); + entries.sort((a, b) => { + return a[1] - b[1]; + }); + + return entries; } const getFingerprintStatus = ( @@ -122,7 +128,7 @@ const getFingerprintStatus = ( const phashList = (