Use case-insensitive sort for games

This commit is contained in:
Sergey Stepanov 2024-03-07 23:18:42 +03:00
parent 84d2261391
commit 72e846894e
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B
2 changed files with 2 additions and 2 deletions

View file

@ -126,7 +126,7 @@
<script src="js/settings/settings.js?v=5"></script>
<script src="js/env.js?v=5"></script>
<script src="js/input/input.js?v=3"></script>
<script src="js/gameList.js?v=3"></script>
<script src="js/gameList.js?v=4"></script>
<script src="js/stream/stream.js?v=7"></script>
<script src="js/room.js?v=3"></script>
<script src="js/network/ajax.js?v=3"></script>

View file

@ -30,7 +30,7 @@ const gameList = (() => {
i > list.length ? i = list.length - 1 :
(i % list.length + list.length) % list.length
},
set: (data = []) => list = data.sort((a, b) => a.title > b.title ? 1 : -1),
set: (data = []) => list = data.sort((a, b) => a.title.toLowerCase() > b.title.toLowerCase() ? 1 : -1),
empty: () => list.length === 0
}
})()