File tree 2 files changed +16
-12
lines changed
2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 12
12
different path, you'll need to set ` publicPath ` in ` webpack.config.js ` to
13
13
your preferred path and then rebuild all assets (e.g. ` make dist ` ).
14
14
- Use ` listenTo ` to avoid memory leaks when views get removed.
15
+ - #1692 Bugfix: ` TypeError: oldest_message is undefined `
16
+
15
17
16
18
## 5.0.1 (2019-08-14)
17
19
Original file line number Diff line number Diff line change @@ -37,19 +37,21 @@ converse.plugins.add('converse-mam-views', {
37
37
const { _converse } = this . __super__ ;
38
38
if ( this . content . scrollTop === 0 && this . model . messages . length ) {
39
39
const oldest_message = this . model . getOldestMessage ( ) ;
40
- const by_jid = this . model . get ( 'jid' ) ;
41
- const stanza_id = oldest_message && oldest_message . get ( `stanza_id ${ by_jid } ` ) ;
42
- this . addSpinner ( ) ;
43
- if ( stanza_id ) {
44
- await this . model . fetchArchivedMessages ( {
45
- 'before' : stanza_id
46
- } ) ;
47
- } else {
48
- await this . model . fetchArchivedMessages ( {
49
- 'end' : oldest_message . get ( 'time' )
50
- } ) ;
40
+ if ( oldest_message ) {
41
+ const by_jid = this . model . get ( 'jid' ) ;
42
+ const stanza_id = oldest_message && oldest_message . get ( `stanza_id ${ by_jid } ` ) ;
43
+ this . addSpinner ( ) ;
44
+ if ( stanza_id ) {
45
+ await this . model . fetchArchivedMessages ( {
46
+ 'before' : stanza_id
47
+ } ) ;
48
+ } else {
49
+ await this . model . fetchArchivedMessages ( {
50
+ 'end' : oldest_message . get ( 'time' )
51
+ } ) ;
52
+ }
53
+ this . clearSpinner ( ) ;
51
54
}
52
- this . clearSpinner ( ) ;
53
55
}
54
56
}
55
57
} ,
You can’t perform that action at this time.
0 commit comments