diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index fd3c939b12..98845ac07f 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -425,12 +425,7 @@ ajaxify.widgets = { render: render }; }); }; - let template500Function = null; - ajaxify.loadTemplate = function (template, callback) { - if (template === '500' && template500Function) { - return callback(template500Function); - } $.ajax({ url: `${config.asset_base_url}/templates/${template}.js`, dataType: 'text', @@ -458,9 +453,7 @@ ajaxify.widgets = { render: render }; translator.translate(`[[global:reconnecting-message, ${config.siteTitle}]]`); Benchpress.registerLoader(ajaxify.loadTemplate); Benchpress.setGlobal('config', config); - ajaxify.loadTemplate('500', function (renderFunction) { - template500Function = renderFunction; - }); + Benchpress.render('500', {}); // loads and caches the 500.tpl }); }());