diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-08 14:51:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-08 14:51:03 +0200 |
commit | 78ff11fc25a0db3d7adfa5b06446b1f9f5ef4a77 (patch) | |
tree | c54fe869ac04cd0731f277b3c930de26e824a5be | |
parent | 7d786e5c1621e1aa41db1d6e7244f16df7343d45 (diff) | |
download | PeerTube-78ff11fc25a0db3d7adfa5b06446b1f9f5ef4a77.tar.gz PeerTube-78ff11fc25a0db3d7adfa5b06446b1f9f5ef4a77.tar.zst PeerTube-78ff11fc25a0db3d7adfa5b06446b1f9f5ef4a77.zip |
Fix client build
-rw-r--r-- | client/src/root-helpers/peertube-web-storage.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/root-helpers/peertube-web-storage.ts b/client/src/root-helpers/peertube-web-storage.ts index 0bbe2c9fc..3622cdc44 100644 --- a/client/src/root-helpers/peertube-web-storage.ts +++ b/client/src/root-helpers/peertube-web-storage.ts | |||
@@ -6,7 +6,8 @@ function proxify (instance: MemoryStorage) { | |||
6 | return new Proxy(instance, { | 6 | return new Proxy(instance, { |
7 | set: function (obj, prop: string | symbol, value) { | 7 | set: function (obj, prop: string | symbol, value) { |
8 | if (Object.prototype.hasOwnProperty.call(MemoryStorage, prop)) { | 8 | if (Object.prototype.hasOwnProperty.call(MemoryStorage, prop)) { |
9 | instance[prop] = value | 9 | // FIXME: remove cast on typescript upgrade |
10 | instance[prop as any] = value | ||
10 | } else { | 11 | } else { |
11 | instance.setItem(prop, value) | 12 | instance.setItem(prop, value) |
12 | } | 13 | } |
@@ -14,8 +15,10 @@ function proxify (instance: MemoryStorage) { | |||
14 | return true | 15 | return true |
15 | }, | 16 | }, |
16 | get: function (target, name: string | symbol | number) { | 17 | get: function (target, name: string | symbol | number) { |
17 | if (typeof instance[name] === 'function') { | 18 | // FIXME: remove cast on typescript upgrade |
18 | return instance[name] | 19 | if (typeof instance[name as any] === 'function') { |
20 | // FIXME: remove cast on typescript upgrade | ||
21 | return instance[name as any] | ||
19 | } else if (valuesMap.has(name)) { | 22 | } else if (valuesMap.has(name)) { |
20 | return instance.getItem(name) | 23 | return instance.getItem(name) |
21 | } | 24 | } |
@@ -24,7 +27,7 @@ function proxify (instance: MemoryStorage) { | |||
24 | } | 27 | } |
25 | 28 | ||
26 | class MemoryStorage implements Storage { | 29 | class MemoryStorage implements Storage { |
27 | [key: string | symbol]: any | 30 | [key: string]: any |
28 | 31 | ||
29 | getItem (key: any) { | 32 | getItem (key: any) { |
30 | const stringKey = String(key) | 33 | const stringKey = String(key) |