[FIX] RoomsList update sometimes isn't fired (#2071)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-04-30 14:38:57 -03:00 committed by GitHub
parent 200f94e244
commit 022b0330bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -212,13 +212,17 @@ class RoomsListView extends React.Component {
this.willFocusListener = navigation.addListener('willFocus', () => { this.willFocusListener = navigation.addListener('willFocus', () => {
// Check if there were changes while not focused (it's set on sCU) // Check if there were changes while not focused (it's set on sCU)
if (this.shouldUpdate) { if (this.shouldUpdate) {
// animateNextTransition();
this.forceUpdate(); this.forceUpdate();
this.shouldUpdate = false; this.shouldUpdate = false;
} }
}); });
this.didFocusListener = navigation.addListener('didFocus', () => { this.didFocusListener = navigation.addListener('didFocus', () => {
this.animated = true; this.animated = true;
// Check if there were changes while not focused (it's set on sCU)
if (this.shouldUpdate) {
this.forceUpdate();
this.shouldUpdate = false;
}
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleBackPress); this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
}); });
this.willBlurListener = navigation.addListener('willBlur', () => { this.willBlurListener = navigation.addListener('willBlur', () => {