Skip to content

Commit

Permalink
Fix embedded.js ChatView
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 25, 2019
1 parent 9ba28e4 commit 396bcc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions js/embedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
self._rooms.forEach(function(room) {
if (room.get('token') === token) {
self.activeRoom = room;
self._chatView.setRoom(room);
}
});
}
Expand All @@ -106,6 +107,7 @@
this._messageCollection = new OCA.SpreedMe.Models.ChatMessageCollection(null, {token: null});
this._chatView = new OCA.SpreedMe.Views.ChatView({
collection: this._messageCollection,
model: this.activeRoom,
id: 'chatView',
guestNameModel: this._localStorageModel
});
Expand Down
2 changes: 1 addition & 1 deletion js/views/chatview.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
this._addCommentTemplate = OCA.Talk.Views.Templates['chatview_add_comment'];
}

var isReadOnly = this.model.get('readOnly') === 1;
var isReadOnly = this.model && this.model.get('readOnly') === 1;
var newMessagePlaceholder = t('spreed', 'New message …');
var submitText = t('spreed', 'Send');
if (isReadOnly) {
Expand Down

0 comments on commit 396bcc7

Please sign in to comment.