1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-22 07:50:04 +02:00

fix load from fresh settings bug

This commit is contained in:
✨ Audrey ✨ 2024-10-21 17:09:39 -04:00
parent adde4fd017
commit a50ab68c94
No known key found for this signature in database
GPG Key ID: 0CF8B4C0D9088B97

View File

@ -252,6 +252,14 @@ export class UserStateSubject<
// * `input` needs to wait until a message flows through the pipe // * `input` needs to wait until a message flows through the pipe
withConstraints, withConstraints,
map(([loadedState, constraints]) => { map(([loadedState, constraints]) => {
// bypass nulls
if (!loadedState) {
return {
constraints: {} as Constraints<State>,
state: null,
} satisfies Constrained<State>;
}
const calibration = isDynamic(constraints) const calibration = isDynamic(constraints)
? constraints.calibrate(loadedState) ? constraints.calibrate(loadedState)
: constraints; : constraints;