Skip to content

Commit 3b1109d

Browse files
committed
ComposeMenu [nfc]: Fix name of insertAttachment prop to be plural
This function is designed to insert multiple attachments.
1 parent 6f2d3da commit 3b1109d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/compose/ComposeBox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef(
319319
);
320320

321321
const [numUploading, setNumUploading] = useState<number>(0);
322-
const insertAttachment = useCallback(
322+
const insertAttachments = useCallback(
323323
async (attachments: $ReadOnlyArray<DocumentPickerResponse>) => {
324324
setNumUploading(n => n + 1);
325325
try {
@@ -744,7 +744,7 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef(
744744
/>
745745
<ComposeMenu
746746
destinationNarrow={destinationNarrow}
747-
insertAttachment={insertAttachment}
747+
insertAttachments={insertAttachments}
748748
insertVideoCallLink={
749749
videoChatProvider !== null ? () => insertVideoCallLink(videoChatProvider) : null
750750
}

src/compose/ComposeMenu.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { SpecificIconType } from '../common/Icons';
2222

2323
type Props = $ReadOnly<{|
2424
destinationNarrow: Narrow,
25-
insertAttachment: ($ReadOnlyArray<DocumentPickerResponse>) => Promise<void>,
25+
insertAttachments: ($ReadOnlyArray<DocumentPickerResponse>) => Promise<void>,
2626
insertVideoCallLink: (() => void) | null,
2727
|}>;
2828

@@ -95,7 +95,7 @@ function MenuButton(props: MenuButtonProps) {
9595
}
9696

9797
export default function ComposeMenu(props: Props): Node {
98-
const { destinationNarrow, insertAttachment, insertVideoCallLink } = props;
98+
const { destinationNarrow, insertAttachments, insertVideoCallLink } = props;
9999

100100
const dispatch = useDispatch();
101101
const _ = useContext(TranslationContext);
@@ -221,8 +221,8 @@ export default function ComposeMenu(props: Props): Node {
221221
return;
222222
}
223223

224-
insertAttachment(response);
225-
}, [_, insertAttachment]);
224+
insertAttachments(response);
225+
}, [_, insertAttachments]);
226226

227227
const styles = useMemo(
228228
() =>

0 commit comments

Comments
 (0)