Browse Source

Tests fixed.

pull/361/head
Sebastian Stehle 7 years ago
parent
commit
9cb5d74c79
  1. 4
      src/Squidex/app/features/administration/state/users.state.ts
  2. 6
      src/Squidex/app/framework/state.ts
  3. 4
      src/Squidex/app/shared/state/schemas.state.ts

4
src/Squidex/app/features/administration/state/users.state.ts

@ -105,7 +105,9 @@ export class UsersState extends State<Snapshot> {
public load(isReload = false): Observable<any> {
if (!isReload) {
this.resetState();
const selectedUser = this.snapshot.selectedUser;
this.resetState({ selectedUser });
}
return this.loadInternal(isReload);

6
src/Squidex/app/framework/state.ts

@ -170,8 +170,12 @@ export class State<T extends {}> {
this.state = new BehaviorSubject(state);
}
public resetState() {
public resetState(update?: ((v: T) => Readonly<T>) | object) {
this.state.next(this.initialState);
if (update) {
this.next(update);
}
}
public next(update: ((v: T) => Readonly<T>) | object) {

4
src/Squidex/app/shared/state/schemas.state.ts

@ -118,7 +118,9 @@ export class SchemasState extends State<Snapshot> {
public load(isReload = false): Observable<any> {
if (!isReload) {
this.resetState();
const selectedSchema = this.snapshot.selectedSchema;
this.resetState({ selectedSchema });
}
return this.schemasService.getSchemas(this.appName).pipe(

Loading…
Cancel
Save