From fac4fc34cc4506f55b024a1404fa81f7ecbc3640 Mon Sep 17 00:00:00 2001 From: diegolmello <diegolmello@gmail.com> Date: Thu, 7 Feb 2019 13:13:35 -0200 Subject: [PATCH] Loop in and out #general channel --- app/views/RoomView/index.js | 8 ++++++++ app/views/RoomsListView/index.js | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index c66c39566..52531461f 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -116,6 +116,14 @@ export default class RoomView extends LoggedView { this.internalSetState({ loaded: true }); } + // eslint-disable-next-line react/sort-comp + componentDidAppear = () => { + setTimeout(async() => { + const { componentId } = this.props; + await Navigation.pop(componentId); + }, 300); + } + shouldComponentUpdate(nextProps, nextState) { const { room, loaded, joined diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index c4805cbb2..cc9d4737a 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -212,6 +212,13 @@ export default class RoomsListView extends LoggedView { return false; } + // eslint-disable-next-line react/sort-comp + componentDidAppear() { + setTimeout(() => { + this.goRoom({ rid: 'GENERAL', name: 'general', t: 'c' }); + }, 300); + } + componentDidUpdate(prevProps) { const { sortBy, groupByType, showFavorites, showUnread, appState -- GitLab