diff --git a/pkg/interface/chat/src/js/components/chat.js b/pkg/interface/chat/src/js/components/chat.js index e596e66d6..cf5ba8936 100644 --- a/pkg/interface/chat/src/js/components/chat.js +++ b/pkg/interface/chat/src/js/components/chat.js @@ -75,8 +75,7 @@ export class ChatScreen extends Component { props.history.push("/~chat"); } else if ( - props.envelopes.length - prevProps.envelopes.length >= - 200 + props.envelopes.length >= prevProps.envelopes.length + 10 ) { this.hasAskedForMessages = false; } @@ -107,11 +106,12 @@ export class ChatScreen extends Component { return; } - let start = props.envelopes[props.envelopes.length - 1].number; + let start = + props.length - props.envelopes[props.envelopes.length - 1].number; if (start > 0) { - let end = start + 200 < props.length ? start + 200 : props.length; + let end = start + 300 < props.length ? start + 300 : props.length; this.hasAskedForMessages = true; - props.subscription.fetchMessages(start, end, props.station); + props.subscription.fetchMessages(start + 1, end, props.station); } } diff --git a/pkg/interface/chat/src/js/reducers/chat-update.js b/pkg/interface/chat/src/js/reducers/chat-update.js index 270e3723d..7ded8c443 100644 --- a/pkg/interface/chat/src/js/reducers/chat-update.js +++ b/pkg/interface/chat/src/js/reducers/chat-update.js @@ -28,8 +28,6 @@ export class ChatUpdateReducer { if (data) { state.inbox[data.path].envelopes = state.inbox[data.path].envelopes.concat(data.envelopes); - state.inbox[data.path].config.length = - state.inbox[data.path].config.length + data.envelopes.length; } }