From bb2893a16cd21b9fcf712ef21cf1e095b329549b Mon Sep 17 00:00:00 2001 From: "Badal@1234" Date: Sun, 19 Apr 2020 21:22:56 +0530 Subject: [PATCH 1/2] [fix]Tablet attachment View and Room Navigation --- app/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/index.js b/app/index.js index cbc099457d..e7415ad7b2 100644 --- a/app/index.js +++ b/app/index.js @@ -449,9 +449,6 @@ const RoomActionsStack = createStackNavigator({ NotificationPrefView: { getScreen: () => require('./views/NotificationPreferencesView').default }, - AttachmentView: { - getScreen: () => require('./views/AttachmentView').default - }, PickerView: { getScreen: () => require('./views/PickerView').default } @@ -469,6 +466,7 @@ const ModalSwitch = createSwitchNavigator({ SettingsStack, ModalBlockStack, CreateDiscussionStack, + AttachmentStack, AuthLoading: () => null }, { @@ -524,7 +522,7 @@ class CustomModalStack extends React.Component { ); - if (isAndroid) { + if (isAndroid && !pageSheet) { content = ( {content} From 954976a71d281802d32a73ab512c04b8fc793948 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 27 Apr 2020 13:51:36 -0300 Subject: [PATCH 2/2] fix weird navigation and margin bottom --- app/index.js | 6 ++-- app/views/RoomActionsView/index.js | 46 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/app/index.js b/app/index.js index e7415ad7b2..832729a62d 100644 --- a/app/index.js +++ b/app/index.js @@ -449,6 +449,9 @@ const RoomActionsStack = createStackNavigator({ NotificationPrefView: { getScreen: () => require('./views/NotificationPreferencesView').default }, + AttachmentView: { + getScreen: () => require('./views/AttachmentView').default + }, PickerView: { getScreen: () => require('./views/PickerView').default } @@ -466,7 +469,6 @@ const ModalSwitch = createSwitchNavigator({ SettingsStack, ModalBlockStack, CreateDiscussionStack, - AttachmentStack, AuthLoading: () => null }, { @@ -512,7 +514,7 @@ class CustomModalStack extends React.Component { const pageSheetViews = ['AttachmentView']; const pageSheet = pageSheetViews.includes(getActiveRouteName(navigation.state)); - const androidProps = isAndroid && { + const androidProps = isAndroid && !pageSheet && { style: { marginBottom: 0 } }; diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index 21dc281f0f..a51fed0ff1 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -87,35 +87,37 @@ class RoomActionsView extends React.Component { async componentDidMount() { this.mounted = true; const { room, member } = this.state; - if (!room.id) { - try { - const result = await RocketChat.getChannelInfo(room.rid); - if (result.success) { - this.setState({ room: { ...result.channel, rid: result.channel._id } }); + if (room.rid) { + if (!room.id) { + try { + const result = await RocketChat.getChannelInfo(room.rid); + if (result.success) { + this.setState({ room: { ...result.channel, rid: result.channel._id } }); + } + } catch (e) { + log(e); } - } catch (e) { - log(e); } - } - if (room && room.t !== 'd' && this.canViewMembers()) { - try { - const counters = await RocketChat.getRoomCounters(room.rid, room.t); - if (counters.success) { - this.setState({ membersCount: counters.members, joined: counters.joined }); + if (room && room.t !== 'd' && this.canViewMembers()) { + try { + const counters = await RocketChat.getRoomCounters(room.rid, room.t); + if (counters.success) { + this.setState({ membersCount: counters.members, joined: counters.joined }); + } + } catch (e) { + log(e); } - } catch (e) { - log(e); + } else if (room.t === 'd' && _.isEmpty(member)) { + this.updateRoomMember(); } - } else if (room.t === 'd' && _.isEmpty(member)) { - this.updateRoomMember(); - } - const canAutoTranslate = await RocketChat.canAutoTranslate(); - this.setState({ canAutoTranslate }); + const canAutoTranslate = await RocketChat.canAutoTranslate(); + this.setState({ canAutoTranslate }); - this.canAddUser(); - this.canInviteUser(); + this.canAddUser(); + this.canInviteUser(); + } } componentWillUnmount() {