about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-02-18 17:22:44 +0100
committerGitHub <noreply@github.com>2020-02-18 17:22:44 +0100
commit1314bba68a5f2d271312bad08f108e1ff56c2c00 (patch)
tree423a6fe659ac324a762ce1935ae4bd9a447b540e /app
parent7584342d836269a9ac865d508ad189f00f87ac95 (diff)
Fix old browsers crashing because of missing `finally` polyfill in web UI (#13115)
Fix #13015
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/base_polyfills.js3
-rw-r--r--app/javascript/mastodon/load_polyfills.js3
2 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/mastodon/base_polyfills.js b/app/javascript/mastodon/base_polyfills.js
index 997813a04..12096d902 100644
--- a/app/javascript/mastodon/base_polyfills.js
+++ b/app/javascript/mastodon/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 './utils/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/mastodon/load_polyfills.js b/app/javascript/mastodon/load_polyfills.js
index 8cb81c1a6..73eedc9dc 100644
--- a/app/javascript/mastodon/load_polyfills.js
+++ b/app/javascript/mastodon/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.