diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-08 14:51:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-11 09:37:26 +0200 |
commit | 52d1477ac45cc7732bcd269fb53ed1d8192996bc (patch) | |
tree | 36759acf72de96c77e37a8b5e2154b775c792bf3 /client/src | |
parent | e93ee8382595dc291d79f43cab492d0e4c9b8e20 (diff) | |
download | PeerTube-52d1477ac45cc7732bcd269fb53ed1d8192996bc.tar.gz PeerTube-52d1477ac45cc7732bcd269fb53ed1d8192996bc.tar.zst PeerTube-52d1477ac45cc7732bcd269fb53ed1d8192996bc.zip |
Fix client build
Diffstat (limited to 'client/src')
-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) |