Update sorting algo

pull/327/head
Kevin Payravi 2023-11-05 01:00:22 -06:00
parent 333ebd71e7
commit 7e73b85f57
1 changed files with 5 additions and 1 deletions

View File

@ -147,7 +147,11 @@ async function loadOptions(lang) {
sites = await getData();
// Sort sites alphabetically by destination
sites.sort((a, b) => a.destination.localeCompare(b.destination));
sites.sort((a, b) => {
a = a.destination.toLowerCase().replace(' ', '');
b = b.destination.toLowerCase().replace(' ', '');
return a < b ? -1 : (a > b ? 1 : 0);
});
chrome.storage.local.get(function (localStorage) {
chrome.storage.sync.get(function (syncStorage) {