Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
this.getSubscriptions();
const { navigation, closeServerDropdown } = this.props;
navigation.setParams({
onPressItem: this._onPressItem,
initSearchingAndroid: this.initSearchingAndroid,
cancelSearchingAndroid: this.cancelSearchingAndroid
});
if (isTablet) {
EventEmitter.addEventListener(KEY_COMMAND, this.handleCommands);
}
Dimensions.addEventListener('change', this.onDimensionsChange);
Orientation.unlockAllOrientations();
this.willFocusListener = navigation.addListener('willFocus', () => {
// Check if there were changes while not focused (it's set on sCU)
if (this.shouldUpdate) {
// animateNextTransition();
this.forceUpdate();
this.shouldUpdate = false;
}
});
this.didFocusListener = navigation.addListener('didFocus', () => {
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
});
this.willBlurListener = navigation.addListener('willBlur', () => {
closeServerDropdown();
if (this.backHandler && this.backHandler.remove) {
this.backHandler.remove();
}
componentDidMount() {
KeepAwake.deactivate();
StatusBar.setHidden(false);
Orientation.unlockAllOrientations();
setTimeout(SplashScreen.hide);
}
this.data = [];
this.state = {
searching: false,
search: [],
loading: true,
chats: [],
unread: [],
favorites: [],
discussions: [],
channels: [],
privateGroup: [],
direct: [],
livechat: [],
width
};
Orientation.unlockAllOrientations();
this.didFocusListener = props.navigation.addListener('didFocus', () => BackHandler.addEventListener('hardwareBackPress', this.handleBackPress));
this.willBlurListener = props.navigation.addListener('willBlur', () => BackHandler.addEventListener('hardwareBackPress', this.handleBackPress));
}
componentWillUnmount() {
const { layout } = this.state;
const { createLayout, navigation } = this.props;
createLayout(navigation.getParam("editedLayout"), layout);
Orientation.unlockAllOrientations();
StatusBar.setHidden(false);
KeepAwake.deactivate();
}
componentWillUnmount() {
const { navigation } = this.props;
navigation.getParam("socketClose")();
Orientation.unlockAllOrientations();
StatusBar.setHidden(false);
KeepAwake.deactivate();
}