Skip to content

Commit

Permalink
improve mobile detect
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Jun 5, 2024
1 parent 8ea01d9 commit bb79970
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Binary file modified landing/bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dependencies": {
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.5.2",
"is-mobile": "^4.0.0",
"svelte-i18next": "^2.2.2",
"svelte-persisted-store": "^0.9.2"
}
Expand Down
12 changes: 2 additions & 10 deletions landing/src/components/Cta.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import GithubIcon from '~/icons/Github.svelte'
import ChipIcon from '~/icons/Chip.svelte'
import latestRelease from '$lib/latest_release.json'
import mobile from 'is-mobile'
let asset = latestRelease.assets.find((a) => a.platform.toLowerCase() === 'macos') // default to macos
let ctaClicked = false
Expand Down Expand Up @@ -60,16 +61,7 @@
})
onMount(() => {
function checkIsMobile() {
var match = window.matchMedia || (window as any).msMatchMedia
if (match) {
var mq = match('(pointer:coarse)')
return mq.matches
}
return false
}
isMobile = checkIsMobile()
isMobile = mobile()
})
const t = $i18n.t
Expand Down

0 comments on commit bb79970

Please sign in to comment.