force message view refresh on subscription update, #127
This commit is contained in:
@@ -298,7 +298,8 @@ class MessagesView extends React.Component {
|
||||
reply: null,
|
||||
contentToEdit: null,
|
||||
showGoToLastButton: false,
|
||||
dragging: false
|
||||
dragging: false,
|
||||
subsVersion: 0
|
||||
};
|
||||
} else if (nextProps.topic != prevState.topic) {
|
||||
const topic = nextProps.tinode.getTopic(nextProps.topic);
|
||||
@@ -669,12 +670,12 @@ class MessagesView extends React.Component {
|
||||
if (this.state.topic) {
|
||||
const subs = [];
|
||||
const topic = this.props.tinode.getTopic(this.state.topic);
|
||||
topic.subscribers((sub) => {
|
||||
topic.subscribers(sub => {
|
||||
if (sub.online && sub.user != this.props.myUserId) {
|
||||
subs.push(sub);
|
||||
}
|
||||
});
|
||||
const newState = {onlineSubs: subs};
|
||||
const newState = {onlineSubs: subs, subsVersion: this.state.subsVersion + 1};
|
||||
const peer = topic.p2pPeerDesc();
|
||||
if (peer) {
|
||||
Object.assign(newState, {
|
||||
|
||||
Reference in New Issue
Block a user