From 0bd78bf30b2ae159791bdc90d17ed18e0327f621 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Mar 2018 14:26:20 +0100 Subject: Proxify local storage and handle if it is unavailable --- client/src/app/core/server/server.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/src/app/core/server/server.service.ts') diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 0b63ef5be..206ec7bcd 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -1,5 +1,6 @@ import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' +import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' import 'rxjs/add/operator/do' import { ReplaySubject } from 'rxjs/ReplaySubject' import { ServerConfig } from '../../../../../shared' @@ -140,11 +141,11 @@ export class ServerService { } private saveConfigLocally (config: ServerConfig) { - localStorage.setItem(ServerService.CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config)) + peertubeLocalStorage.setItem(ServerService.CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config)) } private loadConfigLocally () { - const configString = localStorage.getItem(ServerService.CONFIG_LOCAL_STORAGE_KEY) + const configString = peertubeLocalStorage.getItem(ServerService.CONFIG_LOCAL_STORAGE_KEY) if (configString) { try { -- cgit v1.2.3