Selaa lähdekoodia

Updates #2413

Wrap `history.start` in try/catch clause.
JC Brand 4 vuotta sitten
vanhempi
commit
ce1c5ec7f6
2 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 5 1
      src/headless/core.js
  2. 1 1
      src/plugins/chatview/utils.js

+ 5 - 1
src/headless/core.js

@@ -1563,7 +1563,11 @@ Object.assign(converse, {
         initPlugins();
         registerGlobalEventHandlers();
 
-        !History.started && _converse.router.history.start();
+        try {
+            !History.started && _converse.router.history.start();
+        } catch (e) {
+            log.error(e);
+        }
 
         if (api.settings.get("idle_presence_timeout") > 0) {
             api.listen.on('addClientFeatures', () => api.disco.own.features.add(Strophe.NS.IDLE));

+ 1 - 1
src/plugins/chatview/utils.js

@@ -24,7 +24,7 @@ export async function getHeadingStandaloneButton (promise_or_data) {
     `;
 }
 
-async function clearMessages (chat) {
+export async function clearMessages (chat) {
     const result = confirm(__('Are you sure you want to clear the messages from this conversation?'));
     if (result === true) {
         await chat.clearMessages();