Skip to content

Commit

Permalink
EditStreamCard [nfc]: Use params object for PropsCreateStream, too
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed May 25, 2022
1 parent 2078d31 commit 181bf22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/streams/CreateStreamScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function CreateStreamScreen(props: Props): Node {
const streamsByName = useSelector(getStreamsByName);

const handleComplete = useCallback(
async (name, description, privacy) => {
async ({ name, description, privacy }) => {
// This will miss existing streams that the client can't know about;
// for example, a private stream the user can't access. See comment
// where we catch an `ApiError`, below.
Expand Down
4 changes: 2 additions & 2 deletions src/streams/EditStreamCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type PropsCreateStream = $ReadOnly<{|
...PropsBase,

isNewStream: true,
onComplete: (name: string, description: string, privacy: Privacy) => void | Promise<void>,
onComplete: ({| name: string, description: string, privacy: Privacy |}) => void | Promise<void>,
|}>;

type Props = $ReadOnly<PropsEditStream | PropsCreateStream>;
Expand All @@ -54,7 +54,7 @@ export default function EditStreamCard(props: Props): Node {

const handlePerformAction = useCallback(() => {
if (props.isNewStream) {
props.onComplete(name, description, privacy);
props.onComplete({ name, description, privacy });
} else {
props.onComplete({
name: initialValues.name !== name ? name : undefined,
Expand Down

0 comments on commit 181bf22

Please sign in to comment.