MCPcopy Create free account
hub / github.com/dailydotdev/apps / onShare

Function onShare

packages/shared/src/components/shell/ReadingDrawer.tsx:968–981  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

966 const alwaysLabel = 'Always open links in your browser';
967
968 const onShare = async () => {
969 if (!article.url) {
970 return;
971 }
972 if (!shouldUseNativeShare()) {
973 copyLink({ link: article.url });
974 return;
975 }
976 try {
977 await navigator.share({ title: article.title, url: article.url });
978 } catch {
979 // The sheet was dismissed.
980 }
981 };
982
983 // This page goes to the system browser now and every link after it: the
984 // drawer is gone on this device until the setting is turned back.

Callers 4

onCopyFunction · 0.50
ShareActionsFunction · 0.50
CommentActionButtonsFunction · 0.50
CommentActionButtonsV1Function · 0.50

Calls 2

shouldUseNativeShareFunction · 0.90
copyLinkFunction · 0.50

Tested by

no test coverage detected