From 2c89d784940b91e8610623e282a8cb325041dd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 13 Jun 2023 12:47:43 -0400 Subject: [PATCH] fix: error toast on lost connection --- public/src/ajaxify.js | 3 ++- public/src/client/infinitescroll.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 882013e189..17b3405ae2 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -477,7 +477,8 @@ ajaxify.widgets = { render: render }; translator.translate(`[[global:reconnecting-message, ${config.siteTitle}]]`); Benchpress.registerLoader(ajaxify.loadTemplate); Benchpress.setGlobal('config', config); - Benchpress.render('500', {}); // loads and caches the 500.tpl + Benchpress.render('500', {}); // loads and caches 500.tpl + Benchpress.render('partials/toast'); // loads and caches partials/toast }); }()); diff --git a/public/src/client/infinitescroll.js b/public/src/client/infinitescroll.js index 32f5708a1c..bd6f98d178 100644 --- a/public/src/client/infinitescroll.js +++ b/public/src/client/infinitescroll.js @@ -98,7 +98,7 @@ define('forum/infinitescroll', ['hooks', 'alerts'], function (hooks, alerts) { }); }).fail(function (jqXHR) { loadingMore = false; - alerts.error(String(jqXHR.responseJSON || jqXHR.statusText)); + alerts.error(String(jqXHR.responseJSON || '[[error:no-connection]]')); }); };