Skip to content

Commit

Permalink
UserStatusScreen [nfc]: Match sendToServer to api.updateUserStatus in…
Browse files Browse the repository at this point in the history
… param

It's just a thin wrapper that also dispatches a navigation action.
  • Loading branch information
chrisbobbe committed Mar 2, 2022
1 parent d1dda61 commit 48d6a2e
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 @@ -47,20 +47,20 @@ export default function UserStatusScreen(props: Props): Node {
const _ = useContext(TranslationContext);

const sendToServer = useCallback(
(_statusText: string | null) => {
api.updateUserStatus(auth, { status_text: _statusText });
partialUserStatus => {
api.updateUserStatus(auth, partialUserStatus);
NavigationService.dispatch(navigateBack());
},
[auth],
);

const handlePressUpdate = useCallback(() => {
sendToServer(statusText);
sendToServer({ status_text: statusText });
}, [statusText, sendToServer]);

const handlePressClear = useCallback(() => {
setStatusText(null);
sendToServer(null);
sendToServer({ status_text: null });
}, [sendToServer]);

return (
Expand Down

0 comments on commit 48d6a2e

Please sign in to comment.