diff --git a/libs/common/spec/fake-state.ts b/libs/common/spec/fake-state.ts index 42fa498ffd..2d455fe237 100644 --- a/libs/common/spec/fake-state.ts +++ b/libs/common/spec/fake-state.ts @@ -48,7 +48,7 @@ export class FakeGlobalState implements GlobalState { ? await firstValueFrom(options.combineLatestWith.pipe(timeout(options.msTimeout))) : null; if (!options.shouldUpdate(current, combinedDependencies)) { - return; + return current; } const newState = configureState(current, combinedDependencies); this.stateSubject.next(newState); @@ -77,7 +77,7 @@ export class FakeUserState implements UserState { ? await firstValueFrom(options.combineLatestWith.pipe(timeout(options.msTimeout))) : null; if (!options.shouldUpdate(current, combinedDependencies)) { - return; + return current; } const newState = configureState(current, combinedDependencies); this.stateSubject.next(newState); diff --git a/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts b/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts index 8b4d8edb6b..065f7a8e95 100644 --- a/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts @@ -301,7 +301,7 @@ describe("DefaultActiveUserState", () => { await awaitAsync(); expect(diskStorageService.mock.save).not.toHaveBeenCalled(); - expect(result).toBe(undefined); + expect(result).toBeNull(); expect(emissions).toEqual([null]); }); diff --git a/libs/common/src/platform/state/implementations/default-active-user-state.ts b/libs/common/src/platform/state/implementations/default-active-user-state.ts index 6add6f2db8..3d36af1d61 100644 --- a/libs/common/src/platform/state/implementations/default-active-user-state.ts +++ b/libs/common/src/platform/state/implementations/default-active-user-state.ts @@ -122,7 +122,7 @@ export class DefaultActiveUserState implements ActiveUserState { : null; if (!options.shouldUpdate(currentState, combinedDependencies)) { - return; + return currentState; } const newState = configureState(currentState, combinedDependencies); diff --git a/libs/common/src/platform/state/implementations/default-global-state.spec.ts b/libs/common/src/platform/state/implementations/default-global-state.spec.ts index 05eb9a23ea..ae6cd1adbf 100644 --- a/libs/common/src/platform/state/implementations/default-global-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-global-state.spec.ts @@ -145,7 +145,7 @@ describe("DefaultGlobalState", () => { expect(diskStorageService.mock.save).not.toHaveBeenCalled(); expect(emissions).toEqual([null]); // Initial value - expect(result).toBeUndefined(); + expect(result).toBeNull(); }); it("should provide the update callback with the current State", async () => { diff --git a/libs/common/src/platform/state/implementations/default-global-state.ts b/libs/common/src/platform/state/implementations/default-global-state.ts index f3aea8725d..8e08717f72 100644 --- a/libs/common/src/platform/state/implementations/default-global-state.ts +++ b/libs/common/src/platform/state/implementations/default-global-state.ts @@ -85,7 +85,7 @@ export class DefaultGlobalState implements GlobalState { : null; if (!options.shouldUpdate(currentState, combinedDependencies)) { - return; + return currentState; } const newState = configureState(currentState, combinedDependencies); diff --git a/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts b/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts index 443a176c2e..a25ee863e6 100644 --- a/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts @@ -156,7 +156,7 @@ describe("DefaultSingleUserState", () => { expect(diskStorageService.mock.save).not.toHaveBeenCalled(); expect(emissions).toEqual([null]); // Initial value - expect(result).toBeUndefined(); + expect(result).toBeNull(); }); it("should provide the update callback with the current State", async () => { diff --git a/libs/common/src/platform/state/implementations/default-single-user-state.ts b/libs/common/src/platform/state/implementations/default-single-user-state.ts index aa9abe6b6c..46fa00ffb3 100644 --- a/libs/common/src/platform/state/implementations/default-single-user-state.ts +++ b/libs/common/src/platform/state/implementations/default-single-user-state.ts @@ -91,7 +91,7 @@ export class DefaultSingleUserState implements SingleUserState { : null; if (!options.shouldUpdate(currentState, combinedDependencies)) { - return; + return currentState; } const newState = configureState(currentState, combinedDependencies);