Skip to content

Commit 178416a

Browse files
committed
handleOutboundEvents [nfc]: Have handleLongPress take a params object
1 parent 2fd1061 commit 178416a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/webview/handleOutboundEvents.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,14 @@ const handleImage = (props: Props, src: string, messageId: number) => {
201201
}
202202
};
203203

204-
const handleLongPress = (
204+
const handleLongPress = (args: {|
205205
props: Props,
206206
target: 'message' | 'header' | 'link',
207207
messageId: number,
208208
href: string | null,
209-
) => {
209+
|}) => {
210+
const { props, target, messageId, href } = args;
211+
210212
if (href !== null) {
211213
const url = new URL(href, props.backgroundData.auth.realm).toString();
212214
Clipboard.setString(url);
@@ -281,7 +283,12 @@ export const handleWebViewOutboundEvent = (props: Props, event: WebViewOutboundE
281283
break;
282284

283285
case 'longPress':
284-
handleLongPress(props, event.target, event.messageId, event.href);
286+
handleLongPress({
287+
props,
288+
target: event.target,
289+
messageId: event.messageId,
290+
href: event.href,
291+
});
285292
break;
286293

287294
case 'url':

0 commit comments

Comments
 (0)