[Bug] Change method scope for internal StateMigrationService methods (#619)
A couple of helper methods were recently added to the StateMigrationService, but they were set to private and can't be used in children. Some clients, like the Directory Connector, extend the StateMigrationService and need access to these methods.
This commit is contained in:
parent
54c6a4b3c3
commit
7300db703c
|
@ -409,26 +409,26 @@ export class StateMigrationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private get options(): StorageOptions {
|
protected get options(): StorageOptions {
|
||||||
return { htmlStorageLocation: HtmlStorageLocation.Local };
|
return { htmlStorageLocation: HtmlStorageLocation.Local };
|
||||||
}
|
}
|
||||||
|
|
||||||
private get<T>(key: string): Promise<T> {
|
protected get<T>(key: string): Promise<T> {
|
||||||
return this.storageService.get<T>(key, this.options);
|
return this.storageService.get<T>(key, this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private set(key: string, value: any): Promise<any> {
|
protected set(key: string, value: any): Promise<any> {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return this.storageService.remove(key, this.options);
|
return this.storageService.remove(key, this.options);
|
||||||
}
|
}
|
||||||
return this.storageService.save(key, value, this.options);
|
return this.storageService.save(key, value, this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getGlobals(): Promise<GlobalState> {
|
protected async getGlobals(): Promise<GlobalState> {
|
||||||
return await this.get<GlobalState>(keys.global);
|
return await this.get<GlobalState>(keys.global);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getCurrentStateVersion(): Promise<StateVersion> {
|
protected async getCurrentStateVersion(): Promise<StateVersion> {
|
||||||
return (await this.getGlobals())?.stateVersion;
|
return (await this.getGlobals())?.stateVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue