Skip to content

Commit

Permalink
feat: set maps provider to google by default on mobiles
Browse files Browse the repository at this point in the history
  • Loading branch information
istudyatuni committed Oct 15, 2023
1 parent ccb1340 commit 5d4209f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"migrate-locales": "python scripts/migrate_locales.py"
},
"dependencies": {
"is-mobile": "^4.0.0",
"svelte-i18n": "^3.3.13",
"svelte-storages": "^0.0.1",
"tinro": "^0.6.12"
Expand Down
4 changes: 3 additions & 1 deletion src/stores/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { localStore } from 'svelte-storages'

import { migrateStore } from 'src/stores/migration'
import isMobile from 'is-mobile'

const initial = {
version: 2,
Expand All @@ -14,7 +15,8 @@ const initial = {
// get client timezone
tz: Intl.DateTimeFormat().resolvedOptions().timeZone,
/** @type {import('src/utils/types').OsmProvider} */
maps_provider: 'osm',
// set to google on mobile to support opening links in mobile app
maps_provider: isMobile({ tablet: true }) ? 'google' : 'osm',
}

/** Settings store */
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,11 @@ is-glob@^4.0.1, is-glob@~4.0.1:
dependencies:
is-extglob "^2.1.1"

is-mobile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-4.0.0.tgz#bba396eb9656e2739afde3053d7191da310fc758"
integrity sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==

is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
Expand Down

0 comments on commit 5d4209f

Please sign in to comment.