From a50ab68c94d2372c9d7838f257792916e212811b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=20Audrey=20=E2=9C=A8?= Date: Mon, 21 Oct 2024 17:09:39 -0400 Subject: [PATCH] fix load from fresh settings bug --- libs/common/src/tools/state/user-state-subject.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/common/src/tools/state/user-state-subject.ts b/libs/common/src/tools/state/user-state-subject.ts index 7614011ecc..25bb0b08f4 100644 --- a/libs/common/src/tools/state/user-state-subject.ts +++ b/libs/common/src/tools/state/user-state-subject.ts @@ -252,6 +252,14 @@ export class UserStateSubject< // * `input` needs to wait until a message flows through the pipe withConstraints, map(([loadedState, constraints]) => { + // bypass nulls + if (!loadedState) { + return { + constraints: {} as Constraints, + state: null, + } satisfies Constrained; + } + const calibration = isDynamic(constraints) ? constraints.calibrate(loadedState) : constraints;