Simplifying promises

This commit is contained in:
David Négrier 2021-07-21 18:21:12 +02:00
parent 3cfb74be54
commit 1bb6d893e0
2 changed files with 27 additions and 42 deletions

View file

@ -45,14 +45,15 @@ export class VariablesManager {
/**
* Let's load data from the Redis backend.
*/
public async init(): Promise<void> {
public async init(): Promise<VariablesManager> {
if (!this.shouldPersist()) {
return;
return this;
}
const variables = await variablesRepository.loadVariables(this.roomUrl);
for (const key in variables) {
this._variables.set(key, variables[key]);
}
return this;
}
/**