Skip to content

Commit

Permalink
fix load from fresh settings bug
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyality committed Oct 21, 2024
1 parent adde4fd commit a50ab68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libs/common/src/tools/state/user-state-subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Check warning on line 257 in libs/common/src/tools/state/user-state-subject.ts

View check run for this annotation

Codecov / codecov/patch

libs/common/src/tools/state/user-state-subject.ts#L257

Added line #L257 was not covered by tests
constraints: {} as Constraints<State>,
state: null,
} satisfies Constrained<State>;
}

const calibration = isDynamic(constraints)
? constraints.calibrate(loadedState)
: constraints;
Expand Down

0 comments on commit a50ab68

Please sign in to comment.