diff options
author | ThibG <thib@sitedethib.com> | 2020-02-18 17:22:44 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-02-19 23:10:37 +0100 |
commit | c9166a594318557ab682ba285dc952e9a7da503f (patch) | |
tree | 189920011dc2f681597e121ea12a46a24499edef /app/javascript/flavours | |
parent | e03700240111f42350902387502025fe254fd466 (diff) |
[Glitch] Fix old browsers crashing because of missing `finally` polyfill in web UI
Port 1314bba68a5f2d271312bad08f108e1ff56c2c00 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours')
-rw-r--r-- | app/javascript/flavours/glitch/util/base_polyfills.js | 3 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/util/load_polyfills.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/util/base_polyfills.js b/app/javascript/flavours/glitch/util/base_polyfills.js index ad023eb73..4b8123dba 100644 --- a/app/javascript/flavours/glitch/util/base_polyfills.js +++ b/app/javascript/flavours/glitch/util/base_polyfills.js @@ -6,6 +6,7 @@ import assign from 'object-assign'; import values from 'object.values'; import isNaN from 'is-nan'; import { decode as decodeBase64 } from './base64'; +import promiseFinally from 'promise.prototype.finally'; if (!Array.prototype.includes) { includes.shim(); @@ -23,6 +24,8 @@ if (!Number.isNaN) { Number.isNaN = isNaN; } +promiseFinally.shim(); + if (!HTMLCanvasElement.prototype.toBlob) { const BASE64_MARKER = ';base64,'; diff --git a/app/javascript/flavours/glitch/util/load_polyfills.js b/app/javascript/flavours/glitch/util/load_polyfills.js index 8cb81c1a6..73eedc9dc 100644 --- a/app/javascript/flavours/glitch/util/load_polyfills.js +++ b/app/javascript/flavours/glitch/util/load_polyfills.js @@ -18,7 +18,8 @@ function loadPolyfills() { Number.isNaN && Object.assign && Object.values && - window.Symbol + window.Symbol && + Promise.prototype.finally ); // Latest version of Firefox and Safari do not have IntersectionObserver. |