mirror of
https://github.com/System-End/scraps.git
synced 2026-04-19 22:05:09 +00:00
fix(shop): prioritize user's hearted items in favorites sort
User's own hearted items now sort first, then by global wishlist count within each group. Previously global count came first which buried your own favorites if they weren't popular.
This commit is contained in:
parent
27bc8647a9
commit
12275b553a
3 changed files with 5 additions and 5 deletions
|
|
@ -106,7 +106,7 @@ export default {
|
|||
sort: 'sort:',
|
||||
default: 'default',
|
||||
favorites: 'favorites',
|
||||
favoritesSortHint: 'most wished, then yours',
|
||||
favoritesSortHint: 'yours first, then most wished',
|
||||
probability: 'probability',
|
||||
cost: 'cost (low to high)',
|
||||
loadingItems: 'Loading items...',
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
sort: 'ordenar:',
|
||||
default: 'predeterminado',
|
||||
favorites: 'favoritos',
|
||||
favoritesSortHint: 'más deseados, luego los tuyos',
|
||||
favoritesSortHint: 'los tuyos primero, luego más deseados',
|
||||
probability: 'probabilidad',
|
||||
cost: 'costo (bajo a alto)',
|
||||
loadingItems: 'Cargando artículos...',
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@
|
|||
let items = [...filteredItems];
|
||||
if (sortBy === 'favorites') {
|
||||
return items.sort((a, b) => {
|
||||
if (b.heartCount !== a.heartCount) {
|
||||
return b.heartCount - a.heartCount;
|
||||
}
|
||||
if (a.userHearted !== b.userHearted) {
|
||||
return a.userHearted ? -1 : 1;
|
||||
}
|
||||
if (b.heartCount !== a.heartCount) {
|
||||
return b.heartCount - a.heartCount;
|
||||
}
|
||||
return a.id - b.id;
|
||||
});
|
||||
} else if (sortBy === 'probability') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue