Skip to content

Commit b563683

Browse files
authored
Update live-view.js
1 parent 13c6f74 commit b563683

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

live-view.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,26 @@ function addBottomSwipeListener() {
6161

6262
const shareData = {
6363
title: 'Share live view',
64-
content: window.location.origin
64+
content: 'Open ' + selectedFile.name + ' with Codeit: ' +
65+
window.location.origin + '/?q=' + encodeURIComponent(treeLoc.join(',') + '+' + selectedFile.name + ',' + selectedFile.sha)
6566
}
6667

67-
try {
68-
navigator.share(shareData);
69-
} catch(e) {
70-
console.info('[Share API] Couldn\'t share.');
68+
if (isMobile) {
69+
70+
try {
71+
72+
navigator.share(shareData);
73+
74+
} catch(e) {
75+
76+
copy(shareData.content);
77+
78+
}
79+
80+
} else {
81+
82+
copy(shareData.content);
83+
7184
}
7285

7386
}

0 commit comments

Comments
 (0)