@sumaris-net/ngx-components 2.4.0-rc6 → 2.4.0-rc7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15141,8 +15141,8 @@ class NetworkService extends StartableObservableService {
15141
15141
  */
15142
15142
  async restoreLocally() {
15143
15143
  // Restore from storage
15144
- const settingsStr = await this.storage.get(SETTINGS_STORAGE_KEY);
15145
- const settings = settingsStr && JSON.parse(settingsStr) || undefined;
15144
+ let settings = await this.storage.get(SETTINGS_STORAGE_KEY);
15145
+ settings = (typeof settings === 'string') ? JSON.parse(settings) : settings;
15146
15146
  if (settings && settings.peerUrl) {
15147
15147
  console.debug(`[network] Use peer {${settings.peerUrl}} (found in the local storage)`);
15148
15148
  return Peer.parseUrl(settings.peerUrl);