Merge pull request #4538 from tsiegleauq/history-storrage
Fix history mode store access
This commit is contained in:
commit
3a520705f1
@ -7,6 +7,7 @@ import { User } from '../../shared/models/users/user';
|
||||
import { environment } from 'environments/environment';
|
||||
import { DataStoreService } from './data-store.service';
|
||||
import { OfflineService } from './offline.service';
|
||||
import { OpenSlidesStatusService } from './openslides-status.service';
|
||||
import { ViewUser } from 'app/site/users/models/view-user';
|
||||
import { OnAfterAppsLoaded } from '../onAfterAppsLoaded';
|
||||
import { UserRepositoryService } from '../repositories/users/user-repository.service';
|
||||
@ -128,7 +129,8 @@ export class OperatorService implements OnAfterAppsLoaded {
|
||||
private DS: DataStoreService,
|
||||
private offlineService: OfflineService,
|
||||
private collectionStringMapper: CollectionStringMapperService,
|
||||
private storageService: StorageService
|
||||
private storageService: StorageService,
|
||||
private OSStatus: OpenSlidesStatusService
|
||||
) {
|
||||
this.DS.changeObservable.subscribe(newModel => {
|
||||
if (this._user && newModel instanceof User && this._user.id === newModel.id) {
|
||||
@ -344,7 +346,10 @@ export class OperatorService implements OnAfterAppsLoaded {
|
||||
this.currentWhoAmI = this.getDefaultWhoAmIResponse();
|
||||
}
|
||||
this.currentWhoAmI.permissions = this.permissions;
|
||||
|
||||
if (!this.OSStatus.isInHistoryMode) {
|
||||
await this.storageService.set(WHOAMI_STORAGE_KEY, this.currentWhoAmI);
|
||||
}
|
||||
|
||||
// publish changes in the operator.
|
||||
this.operatorSubject.next(this.user);
|
||||
|
@ -82,9 +82,9 @@ export class TimeTravelService {
|
||||
* all missed auto updates are requested.
|
||||
*/
|
||||
public async resumeTime(): Promise<void> {
|
||||
this.OSStatus.leaveHistoryMode();
|
||||
await this.DS.set();
|
||||
await this.OpenSlides.reboot();
|
||||
this.OSStatus.leaveHistoryMode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
import { ConfigService } from './config.service';
|
||||
import { StorageService } from '../core-services/storage.service';
|
||||
import { OpenSlidesStatusService } from '../core-services/openslides-status.service';
|
||||
|
||||
/**
|
||||
* The login data send by the server.
|
||||
@ -65,7 +66,11 @@ export class LoginDataService {
|
||||
* policy and legal notice, when their config values change.
|
||||
* @param configService
|
||||
*/
|
||||
public constructor(private configService: ConfigService, private storageService: StorageService) {
|
||||
public constructor(
|
||||
private configService: ConfigService,
|
||||
private storageService: StorageService,
|
||||
private OSStatus: OpenSlidesStatusService
|
||||
) {
|
||||
this.configService.get<string>('general_event_privacy_policy').subscribe(value => {
|
||||
this._privacy_policy.next(value);
|
||||
this.storeLoginData();
|
||||
@ -118,6 +123,8 @@ export class LoginDataService {
|
||||
theme: this._theme.getValue()
|
||||
};
|
||||
}
|
||||
if (!this.OSStatus.isInHistoryMode) {
|
||||
this.storageService.set(LOGIN_DATA_STORAGE_KEY, loginData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user