make user preference save public

This commit is contained in:
Dan Percic 2022-12-02 19:28:42 +02:00
parent c2aa517cb7
commit 70938dcea2

View File

@ -29,7 +29,7 @@ export abstract class IqserUserPreferenceService extends GenericService<UserAttr
}
async saveTheme(theme: 'light' | 'dark'): Promise<void> {
await this._save(KEYS.theme, theme);
await this.save(KEYS.theme, theme);
window.location.reload();
}
@ -38,7 +38,7 @@ export abstract class IqserUserPreferenceService extends GenericService<UserAttr
}
async saveLanguage(language: string): Promise<void> {
await this._save(KEYS.language, language);
await this.save(KEYS.language, language);
}
toggleDevFeatures(): void {
@ -56,7 +56,7 @@ export abstract class IqserUserPreferenceService extends GenericService<UserAttr
return this._put(body, `${this._defaultModelPath}/${key}`);
}
protected async _save(key: string, value: string): Promise<void> {
public async save(key: string, value: string): Promise<void> {
this.userAttributes[key] = [value];
await firstValueFrom(this.savePreferences([value], key));
}