mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-19 13:56:58 -04:00
Remap score to combined_score for common ancestor in prediction results
Duplicative with existing change in MOB-513’s confidence calculation fix, but makes a combined score available for sorting or filtering.
This commit is contained in:
@@ -78,11 +78,16 @@ const filterSuggestions = ( suggestionsToFilter, usingOfflineSuggestions, common
|
||||
};
|
||||
}
|
||||
|
||||
// online common ancestor
|
||||
// online or offline common ancestor
|
||||
if ( commonAncestor ) {
|
||||
const sortableCommonAncestor = {
|
||||
...commonAncestor,
|
||||
// temp patch to let calling code sort online common ancestor with other suggestions
|
||||
combined_score: commonAncestor.combined_score ?? commonAncestor.score
|
||||
};
|
||||
return {
|
||||
...newSuggestions,
|
||||
topSuggestion: commonAncestor,
|
||||
topSuggestion: sortableCommonAncestor,
|
||||
topSuggestionType: TOP_SUGGESTION_COMMON_ANCESTOR
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user