Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] AttachmentView (Android)(Tablet) #2047

Merged
merged 3 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,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 }
};

Expand All @@ -524,7 +524,7 @@ class CustomModalStack extends React.Component {
</View>
);

if (isAndroid) {
if (isAndroid && !pageSheet) {
content = (
<ScrollView overScrollMode='never'>
{content}
Expand Down
46 changes: 24 additions & 22 deletions app/views/RoomActionsView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down