Skip to content

Commit

Permalink
RoomView header button navigate to E2EEToggleRoomView
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Nov 29, 2024
1 parent 17c2f6b commit 4bc7f7e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions app/views/RoomView/RightButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { TNavigation } from '../../stacks/stackType';
import { ChatsStackParamList } from '../../stacks/types';
import { HeaderCallButton } from './components';
import { TColors, TSupportedThemes, withTheme } from '../../theme';
import { toggleRoomE2EE } from '../../lib/encryption/helpers/toggleRoomE2EE';

interface IRightButtonsProps extends Pick<ISubscription, 't'> {
userId?: string;
Expand Down Expand Up @@ -391,6 +390,24 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS
}
};

goE2EEToggleRoomView = () => {
logEvent(events.ROOM_GO_SEARCH);
const { rid, navigation, isMasterDetail } = this.props;
if (!rid) {
return;
}
// if (isMasterDetail) {
// // @ts-ignore TODO: find a way to make this work
// navigation.navigate('ModalStackNavigator', {
// screen: 'SearchMessagesView',
// params: { rid, showCloseModal: true, encrypted }
// });
// } else {
// @ts-ignore
navigation.navigate('E2EEToggleRoomView', { rid });
// }
};

toggleFollowThread = () => {
logEvent(events.ROOM_TOGGLE_FOLLOW_THREADS);
const { isFollowingThread } = this.state;
Expand Down Expand Up @@ -442,7 +459,7 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS
return (
<HeaderButton.Container onLayout={this.onLayout}>
{hasE2EEWarning ? (
<HeaderButton.Item iconName='encrypted' onPress={() => toggleRoomE2EE(rid)} disabled={!canToggleEncryption} />
<HeaderButton.Item iconName='encrypted' onPress={this.goE2EEToggleRoomView} disabled={!canToggleEncryption} />
) : null}
{issuesWithNotifications || notificationsDisabled ? (
<HeaderButton.Item
Expand Down

0 comments on commit 4bc7f7e

Please sign in to comment.