public loadProfile()

in client/src/services/local-profile.ts [10:29]


  public loadProfile(): Promise<Profile> {
    const serializedProfile = window.localStorage.getItem('profile');
    let profile: Profile|null = null;
    if (serializedProfile) {
      try {
       profile = JSON.parse(serializedProfile);
      } catch (err) {
        logger.warn('Error parsing profile', err);
      }
    }
    if (!profile) {
      profile = {
        termsAgreed: false,
        introViewed: false,
        language: null,
        endangeredLanguage: null
      };
    }
    return Promise.resolve(profile);
  }