aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/images/global-icon.component.ts1
-rw-r--r--client/src/app/shared/misc/peertube-web-storage.ts (renamed from client/src/app/shared/misc/peertube-local-storage.ts)9
-rw-r--r--client/src/app/shared/rest/rest-table.ts2
3 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/shared/images/global-icon.component.ts b/client/src/app/shared/images/global-icon.component.ts
index eb723db94..31cfe2666 100644
--- a/client/src/app/shared/images/global-icon.component.ts
+++ b/client/src/app/shared/images/global-icon.component.ts
@@ -26,6 +26,7 @@ const icons = {
26 'cross': require('!!raw-loader?!../../../assets/images/global/cross.svg'), 26 'cross': require('!!raw-loader?!../../../assets/images/global/cross.svg'),
27 'validate': require('!!raw-loader?!../../../assets/images/global/validate.svg'), 27 'validate': require('!!raw-loader?!../../../assets/images/global/validate.svg'),
28 'tick': require('!!raw-loader?!../../../assets/images/global/tick.svg'), 28 'tick': require('!!raw-loader?!../../../assets/images/global/tick.svg'),
29 'repeat': require('!!raw-loader?!../../../assets/images/global/repeat.svg'),
29 'dislike': require('!!raw-loader?!../../../assets/images/video/dislike.svg'), 30 'dislike': require('!!raw-loader?!../../../assets/images/video/dislike.svg'),
30 'support': require('!!raw-loader?!../../../assets/images/video/support.svg'), 31 'support': require('!!raw-loader?!../../../assets/images/video/support.svg'),
31 'like': require('!!raw-loader?!../../../assets/images/video/like.svg'), 32 'like': require('!!raw-loader?!../../../assets/images/video/like.svg'),
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
44let peertubeLocalStorage: Storage 44let peertubeLocalStorage: Storage
45let peertubeSessionStorage: Storage
45try { 46try {
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
70export { peertubeLocalStorage } 72export {
73 peertubeLocalStorage,
74 peertubeSessionStorage
75}
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts
index 884588207..c180346af 100644
--- a/client/src/app/shared/rest/rest-table.ts
+++ b/client/src/app/shared/rest/rest-table.ts
@@ -1,4 +1,4 @@
1import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' 1import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
2import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent' 2import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent'
3import { SortMeta } from 'primeng/components/common/sortmeta' 3import { SortMeta } from 'primeng/components/common/sortmeta'
4import { RestPagination } from './rest-pagination' 4import { RestPagination } from './rest-pagination'