1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

fix sort order

This commit is contained in:
✨ Audrey ✨
2025-04-30 11:04:21 -04:00
parent 12e6ffde2f
commit 4e5c2934e6
2 changed files with 12 additions and 6 deletions

View File

@@ -174,13 +174,16 @@ export class CredentialGeneratorComponent implements OnInit, OnChanges, OnDestro
// construct options for username and email algorithms; replace forwarder
// entry with a virtual entry for drill-down
const usernames = algorithms.filter((a) => !isForwarderExtensionId(a.id));
usernames.sort((username) => username.weight);
usernames.sort((a, b) => a.weight - b.weight);
const usernameOptions = this.toOptions(usernames);
usernameOptions.push({ value: FORWARDER, label: this.i18nService.t("forwardedEmail") });
usernameOptions.splice(-1, 0, {
value: FORWARDER,
label: this.i18nService.t("forwardedEmail"),
});
// construct options for forwarder algorithms; they get their own selection box
const forwarders = algorithms.filter((a) => isForwarderExtensionId(a.id));
forwarders.sort((forwarder) => forwarder.weight);
forwarders.sort((a, b) => a.weight - b.weight);
const forwarderOptions = this.toOptions(forwarders);
forwarderOptions.unshift({ value: NONE_SELECTED, label: this.i18nService.t("select") });

View File

@@ -175,13 +175,16 @@ export class UsernameGeneratorComponent implements OnInit, OnChanges, OnDestroy
// construct options for username and email algorithms; replace forwarder
// entry with a virtual entry for drill-down
const usernames = algorithms.filter((a) => !isForwarderExtensionId(a.id));
usernames.sort((username) => username.weight);
usernames.sort((a, b) => a.weight - b.weight);
const usernameOptions = this.toOptions(usernames);
usernameOptions.push({ value: FORWARDER, label: this.i18nService.t("forwardedEmail") });
usernameOptions.splice(-1, 0, {
value: FORWARDER,
label: this.i18nService.t("forwardedEmail"),
});
// construct options for forwarder algorithms; they get their own selection box
const forwarders = algorithms.filter((a) => isForwarderExtensionId(a.id));
forwarders.sort((forwarder) => forwarder.weight);
forwarders.sort((a, b) => a.weight - b.weight);
const forwarderOptions = this.toOptions(forwarders);
forwarderOptions.unshift({ value: NONE_SELECTED, label: this.i18nService.t("select") });