Skip to content

Commit

Permalink
fix: Properly compare languages and names, scroll to source if there'…
Browse files Browse the repository at this point in the history
…s a hash
  • Loading branch information
beer-psi committed Jul 26, 2023
1 parent 01b8c6f commit b2853d5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/build/web/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@

const [langLhs] = languageName(lhs.lang);
const [langRhs] = languageName(rhs.lang);
if (langLhs < langRhs) {
return -1;
}
if (langRhs > langLhs) {
return 1;
}
return lhs.name < rhs.name ? -1 : lhs.name === rhs.name ? 0 : 1;
return langLhs.localeCompare(langRhs) || lhs.name.localeCompare(rhs.name);
});
this.languages = [...new Set(this.sources.map((source) => source.lang))];
this.loading = LoadingStatus.Loaded;
} catch {
this.loading = LoadingStatus.Error;
}

if (scope.location.hash) {
this.$nextTick(() => {
scope.location.replace(scope.location.hash);
});
}
},

updateFilteredList() {
Expand Down

0 comments on commit b2853d5

Please sign in to comment.