Skip to content

Commit

Permalink
URLエンコード
Browse files Browse the repository at this point in the history
  • Loading branch information
ef81sp committed Jan 4, 2025
1 parent ac5b7d0 commit 981d605
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/Nanimachi100Result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ const text = computed(
問題モード: ${type === 'tamenmachi' ? '多面待ち' : '通常'}
手牌枚数: ${length}`,
)
const url = 'https://menchin.p_craft.dev/nanimachi100'
const url = encodeURIComponent('https://menchin.p_craft.dev/nanimachi100')
const shareText = computed(
() => `${text.value}
${url}`,
)
const handleShare = async () => {
const isSP = navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)
if (isSP) {
await navigator.share({
title: '何待ち100本ノック',
text: text.value,
url,
})
const shareData = {
title: '何待ち100本ノック',
text: shareText.value,
url,
}
if (isSP && navigator.canShare(shareData)) {
await navigator.share(shareData)
return
} else {
shareDialog.value?.open()
Expand Down

0 comments on commit 981d605

Please sign in to comment.