mirror of
https://github.com/bitwarden/browser
synced 2026-02-12 22:44:11 +00:00
Merge branch 'main' into vault/PM-12049
This commit is contained in:
@@ -102,8 +102,8 @@ export class PassphraseSettingsComponent implements OnInit, OnDestroy {
|
||||
|
||||
const boundariesHint = this.i18nService.t(
|
||||
"generatorBoundariesHint",
|
||||
constraints.numWords.min,
|
||||
constraints.numWords.max,
|
||||
constraints.numWords.min?.toString(),
|
||||
constraints.numWords.max?.toString(),
|
||||
);
|
||||
this.numWordsBoundariesHint.next(boundariesHint);
|
||||
});
|
||||
|
||||
@@ -171,10 +171,10 @@ export class PasswordSettingsComponent implements OnInit, OnDestroy {
|
||||
this.minNumber.valueChanges
|
||||
.pipe(
|
||||
map((value) => [value, value > 0] as const),
|
||||
tap(([value]) => (lastMinNumber = this.numbers.value ? value : lastMinNumber)),
|
||||
tap(([value, checkNumbers]) => (lastMinNumber = checkNumbers ? value : lastMinNumber)),
|
||||
takeUntil(this.destroyed$),
|
||||
)
|
||||
.subscribe(([, checked]) => this.numbers.setValue(checked, { emitEvent: false }));
|
||||
.subscribe(([, checkNumbers]) => this.numbers.setValue(checkNumbers, { emitEvent: false }));
|
||||
|
||||
let lastMinSpecial = 1;
|
||||
this.special.valueChanges
|
||||
@@ -188,10 +188,10 @@ export class PasswordSettingsComponent implements OnInit, OnDestroy {
|
||||
this.minSpecial.valueChanges
|
||||
.pipe(
|
||||
map((value) => [value, value > 0] as const),
|
||||
tap(([value]) => (lastMinSpecial = this.special.value ? value : lastMinSpecial)),
|
||||
tap(([value, checkSpecial]) => (lastMinSpecial = checkSpecial ? value : lastMinSpecial)),
|
||||
takeUntil(this.destroyed$),
|
||||
)
|
||||
.subscribe(([, checked]) => this.special.setValue(checked, { emitEvent: false }));
|
||||
.subscribe(([, checkSpecial]) => this.special.setValue(checkSpecial, { emitEvent: false }));
|
||||
|
||||
// `onUpdated` depends on `settings` because the UserStateSubject is asynchronous;
|
||||
// subscribing directly to `this.settings.valueChanges` introduces a race condition.
|
||||
|
||||
@@ -1163,7 +1163,11 @@ describe("CredentialGeneratorService", () => {
|
||||
await awaitAsync();
|
||||
const result = await firstValueFrom(stateProvider.getUserState$(SettingsKey, SomeUser));
|
||||
|
||||
expect(result).toEqual({ foo: "next value" });
|
||||
expect(result).toEqual({
|
||||
foo: "next value",
|
||||
// FIXME: don't leak this detail into the test
|
||||
"$^$ALWAYS_UPDATE_KLUDGE_PROPERTY$^$": 0,
|
||||
});
|
||||
});
|
||||
|
||||
it("waits for the user to become available", async () => {
|
||||
|
||||
Reference in New Issue
Block a user