Skip to content

Commit fffd7c3

Browse files
committed
fix typo
1 parent 4455ac8 commit fffd7c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const App: FunctionComponent<AppProps> = ({ Component, pageProps }) => {
2525
if (window.navigator.share) {
2626
const title = document.title;
2727
const url = window.location.href;
28-
const text = document.querySelector("meta[property='description']").getAttribute('content');
28+
const descriptionEl = document.querySelector("meta[name='description']");
29+
const text = descriptionEl ? descriptionEl.getAttribute('content') : '';
2930
return window.navigator.share({ title, text: `${text} ${url}` });
3031
}
3132
// fallback to custom native share dialog

0 commit comments

Comments
 (0)