From 9bf1b9f2a2a200002eb7dfe0ebf53b3656585ebd Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 16 Jul 2020 09:31:35 +0100 Subject: [PATCH] bugfix / testing: Ie11 warning for not having Promises (#4167) Makes IE11 work again but may cause an issue for plugin testing in IE11. IE plugin tests in IE11 will probably fail as the plugin code will not execute. --- src/static/js/pluginfw/hooks.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index 489709e33..e9700c37f 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -96,11 +96,16 @@ function aCallAll(hook_name, args, cb) { /* return a Promise if cb is not supplied */ exports.aCallAll = function (hook_name, args, cb) { if (cb === undefined) { - return new Promise(function(resolve, reject) { - aCallAll(hook_name, args, function(err, res) { - return err ? reject(err) : resolve(res); + try{ + return new Promise(function(resolve, reject) { + aCallAll(hook_name, args, function(err, res) { + return err ? reject(err) : resolve(res); + }); }); - }); + }catch(e){ + $.gritter.removeAll(); + $.gritter.add("Please update your web browser") + } } else { return aCallAll(hook_name, args, cb); }