diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-11 22:13:20 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-13 09:13:43 +0100 |
commit | 88a7f93f8e5666f44121a2e3cf9d33d74c472aa7 (patch) | |
tree | 01a5d765f9ffed5cc4cbfc7b8c5fc14eb61548a7 /client/src/app/shared/misc | |
parent | 12f18b90ba6395464606052bb1bdfedb6b83df13 (diff) | |
download | PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.tar.gz PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.tar.zst PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.zip |
add loop setting for playlists, and use sessionStorage
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/peertube-web-storage.ts (renamed from client/src/app/shared/misc/peertube-local-storage.ts) | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/shared/misc/peertube-local-storage.ts b/client/src/app/shared/misc/peertube-web-storage.ts index fb5c45acf..fff209678 100644 --- a/client/src/app/shared/misc/peertube-local-storage.ts +++ b/client/src/app/shared/misc/peertube-web-storage.ts | |||
@@ -42,12 +42,14 @@ class MemoryStorage { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | let peertubeLocalStorage: Storage | 44 | let peertubeLocalStorage: Storage |
45 | let peertubeSessionStorage: Storage | ||
45 | try { | 46 | try { |
46 | peertubeLocalStorage = localStorage | 47 | peertubeLocalStorage = localStorage |
48 | peertubeSessionStorage = sessionStorage | ||
47 | } catch (err) { | 49 | } catch (err) { |
48 | const instance = new MemoryStorage() | 50 | const instance = new MemoryStorage() |
49 | 51 | ||
50 | peertubeLocalStorage = new Proxy(instance, { | 52 | peertubeLocalStorage = sessionStorage = new Proxy(instance, { |
51 | set: function (obj, prop: string | number, value) { | 53 | set: function (obj, prop: string | number, value) { |
52 | if (MemoryStorage.prototype.hasOwnProperty(prop)) { | 54 | if (MemoryStorage.prototype.hasOwnProperty(prop)) { |
53 | instance[prop] = value | 55 | instance[prop] = value |
@@ -67,4 +69,7 @@ try { | |||
67 | }) | 69 | }) |
68 | } | 70 | } |
69 | 71 | ||
70 | export { peertubeLocalStorage } | 72 | export { |
73 | peertubeLocalStorage, | ||
74 | peertubeSessionStorage | ||
75 | } | ||