Spaces:
Sleeping
Sleeping
fix(share): use copy link on desktop (#1477)
Browse files- src/lib/utils/share.ts +2 -1
src/lib/utils/share.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import { browser } from "$app/environment";
|
|
|
|
| 2 |
|
| 3 |
export async function share(url: string, title: string, appendLeafId: boolean = false) {
|
| 4 |
if (!browser) return;
|
|
@@ -13,7 +14,7 @@ export async function share(url: string, title: string, appendLeafId: boolean =
|
|
| 13 |
url = shareUrl.toString();
|
| 14 |
}
|
| 15 |
|
| 16 |
-
if (navigator.share) {
|
| 17 |
navigator.share({ url, title });
|
| 18 |
} else {
|
| 19 |
if (document.hasFocus()) {
|
|
|
|
| 1 |
import { browser } from "$app/environment";
|
| 2 |
+
import { isDesktop } from "./isDesktop";
|
| 3 |
|
| 4 |
export async function share(url: string, title: string, appendLeafId: boolean = false) {
|
| 5 |
if (!browser) return;
|
|
|
|
| 14 |
url = shareUrl.toString();
|
| 15 |
}
|
| 16 |
|
| 17 |
+
if (navigator.share && !isDesktop(window)) {
|
| 18 |
navigator.share({ url, title });
|
| 19 |
} else {
|
| 20 |
if (document.hasFocus()) {
|