Commit 46ccc1a8 authored by JC Brand's avatar JC Brand

Fixes #1692

parent cc91f375
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
different path, you'll need to set `publicPath` in `webpack.config.js` to different path, you'll need to set `publicPath` in `webpack.config.js` to
your preferred path and then rebuild all assets (e.g. `make dist`). your preferred path and then rebuild all assets (e.g. `make dist`).
- Use `listenTo` to avoid memory leaks when views get removed. - Use `listenTo` to avoid memory leaks when views get removed.
- #1692 Bugfix: `TypeError: oldest_message is undefined`
## 5.0.1 (2019-08-14) ## 5.0.1 (2019-08-14)
......
...@@ -37,6 +37,7 @@ converse.plugins.add('converse-mam-views', { ...@@ -37,6 +37,7 @@ converse.plugins.add('converse-mam-views', {
const { _converse } = this.__super__; const { _converse } = this.__super__;
if (this.content.scrollTop === 0 && this.model.messages.length) { if (this.content.scrollTop === 0 && this.model.messages.length) {
const oldest_message = this.model.getOldestMessage(); const oldest_message = this.model.getOldestMessage();
if (oldest_message) {
const by_jid = this.model.get('jid'); const by_jid = this.model.get('jid');
const stanza_id = oldest_message && oldest_message.get(`stanza_id ${by_jid}`); const stanza_id = oldest_message && oldest_message.get(`stanza_id ${by_jid}`);
this.addSpinner(); this.addSpinner();
...@@ -52,6 +53,7 @@ converse.plugins.add('converse-mam-views', { ...@@ -52,6 +53,7 @@ converse.plugins.add('converse-mam-views', {
this.clearSpinner(); this.clearSpinner();
} }
} }
}
}, },
ChatRoomView: { ChatRoomView: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment