瀏覽代碼

Updates #2413

Wrap `history.start` in try/catch clause.
JC Brand 4 年之前
父節點
當前提交
ce1c5ec7f6
共有 2 個文件被更改,包括 6 次插入2 次删除
  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();