diff --git a/src/Squidex/app/features/administration/state/users.state.ts b/src/Squidex/app/features/administration/state/users.state.ts index 2fc07e298..7de907b24 100644 --- a/src/Squidex/app/features/administration/state/users.state.ts +++ b/src/Squidex/app/features/administration/state/users.state.ts @@ -105,7 +105,9 @@ export class UsersState extends State { public load(isReload = false): Observable { if (!isReload) { - this.resetState(); + const selectedUser = this.snapshot.selectedUser; + + this.resetState({ selectedUser }); } return this.loadInternal(isReload); diff --git a/src/Squidex/app/framework/state.ts b/src/Squidex/app/framework/state.ts index a0af32cdb..479a006e1 100644 --- a/src/Squidex/app/framework/state.ts +++ b/src/Squidex/app/framework/state.ts @@ -170,8 +170,12 @@ export class State { this.state = new BehaviorSubject(state); } - public resetState() { + public resetState(update?: ((v: T) => Readonly) | object) { this.state.next(this.initialState); + + if (update) { + this.next(update); + } } public next(update: ((v: T) => Readonly) | object) { diff --git a/src/Squidex/app/shared/state/schemas.state.ts b/src/Squidex/app/shared/state/schemas.state.ts index 25493e05e..bece9616f 100644 --- a/src/Squidex/app/shared/state/schemas.state.ts +++ b/src/Squidex/app/shared/state/schemas.state.ts @@ -118,7 +118,9 @@ export class SchemasState extends State { public load(isReload = false): Observable { if (!isReload) { - this.resetState(); + const selectedSchema = this.snapshot.selectedSchema; + + this.resetState({ selectedSchema }); } return this.schemasService.getSchemas(this.appName).pipe(