message: Improving local storing handling by try-cache all setItem calls and resetting storage on failure. Fixes:
diff: @@ -218,17 +218,18 @@ export class GalleryCacheService {
  }
  try {
  + // try to fit it
  localStorage.setItem(key, JSON.stringify(directory));
  - } catch (e) {
  - this.reset();
  - console.error(e);
  - }
  directory.directories.forEach((dir: DirectoryDTO) => {
  const sub_key = GalleryCacheService.CONTENT_PREFIX + Utils.concatUrls(dir.path, dir.name);
  if (localStorage.getItem(sub_key) == null) { // don't override existing
  localStorage.setItem(sub_key, JSON.stringify(dir));
  }
  });
  + } catch (e) {
  + this.reset();
  + console.error(e);
  + }
  }
  @@ -242,6 +243,7 @@ export class GalleryCacheService {
  return;
  }
  + try {
  const directoryName = Utils.concatUrls(media.directory.path, media.directory.name);
  const value = localStorage.getItem(directoryName);
  if (value != null) {
  @@ -258,6 +260,10 @@ export class GalleryCacheService {
  }
  });
  }
  + } catch (e) {
  + this.reset();
  + console.error(e);
  + }
  }
  