Skip to content

Commit

Permalink
UserStatusScreen [nfc]: Stop using disfavored NavigationService
Browse files Browse the repository at this point in the history
For some background, see zulip#4417.
  • Loading branch information
chrisbobbe committed Mar 2, 2022
1 parent 48d6a2e commit 516263d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/user-statuses/UserStatusScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { createStyleSheet } from '../styles';

import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';
import * as NavigationService from '../nav/NavigationService';
import { useSelector } from '../react-redux';
import Input from '../common/Input';
import SelectableOptionRow from '../common/SelectableOptionRow';
Expand All @@ -17,7 +16,6 @@ import { getAuth, getOwnUserId } from '../selectors';
import { getUserStatus } from './userStatusesModel';
import { IconCancel, IconDone } from '../common/Icons';
import statusSuggestions from './userStatusTextSuggestions';
import { navigateBack } from '../nav/navActions';
import * as api from '../api';

const styles = createStyleSheet({
Expand All @@ -39,6 +37,8 @@ type Props = $ReadOnly<{|
|}>;

export default function UserStatusScreen(props: Props): Node {
const { navigation } = props;

const auth = useSelector(getAuth);
const ownUserId = useSelector(getOwnUserId);
const userStatusText = useSelector(state => getUserStatus(state, ownUserId).status_text);
Expand All @@ -49,9 +49,9 @@ export default function UserStatusScreen(props: Props): Node {
const sendToServer = useCallback(
partialUserStatus => {
api.updateUserStatus(auth, partialUserStatus);
NavigationService.dispatch(navigateBack());
navigation.goBack();
},
[auth],
[navigation, auth],
);

const handlePressUpdate = useCallback(() => {
Expand Down

0 comments on commit 516263d

Please sign in to comment.