소스 검색

Only add view to `chatboxviews` after `this.model` has been set

Otherwise race-conditions arise where `this.model` is undefined
JC Brand 4 년 전
부모
커밋
548021b556
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/plugins/muc-views/muc.js

+ 1 - 1
src/plugins/muc-views/muc.js

@@ -19,8 +19,8 @@ export default class MUCView extends BaseChatView {
 
     async initialize () {
         const jid = this.getAttribute('jid');
-        _converse.chatboxviews.add(jid, this);
         this.model = _converse.chatboxes.get(jid);
+        _converse.chatboxviews.add(jid, this);
         this.initDebounced();
 
         this.listenTo(_converse, 'windowStateChanged', this.onWindowStateChanged);