diff --git a/src/lib/services/base-user-preference.service.ts b/src/lib/services/base-user-preference.service.ts index 41dc97f..00c0750 100644 --- a/src/lib/services/base-user-preference.service.ts +++ b/src/lib/services/base-user-preference.service.ts @@ -56,12 +56,12 @@ export abstract class BaseUserPreferenceService extends GenericService { + protected async _save(key: string, value: string): Promise { this.userAttributes[key] = [value]; await firstValueFrom(this.savePreferences([value], key)); } - private _getAttribute(key: string, defaultValue = ''): string { + protected _getAttribute(key: string, defaultValue = ''): string { if (this.userAttributes[key]?.length > 0) { return this.userAttributes[key][0]; } diff --git a/src/lib/utils/tokens.ts b/src/lib/utils/tokens.ts index dfe414c..0943d7f 100644 --- a/src/lib/utils/tokens.ts +++ b/src/lib/utils/tokens.ts @@ -19,16 +19,15 @@ export const BASE_HREF = new InjectionToken('BASE_HREF', { export type BaseHrefFn = (path: string) => string; export const BASE_HREF_FN = new InjectionToken('Convert path function', { - factory: () => (path: string) => { + factory: () => { const baseUrl = inject(BASE_HREF); - if (!baseUrl) { - throw new Error('BASE_HREF is not defined'); - } - if (path[0] === '/') { - return baseUrl + path; - } + return (path: string) => { + if (path[0] === '/') { + return baseUrl + path; + } - return baseUrl + '/' + path; + return baseUrl + '/' + path; + }; }, });