feat: share list
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export async function shareLink(
|
||||
title: string,
|
||||
text: string,
|
||||
url: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
if (navigator.canShare()) {
|
||||
await navigator.share({ title, text, url });
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
await navigator.clipboard.writeText(url);
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user