Skip to content

Commit

Permalink
fix: fetch and cache location on app startup (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
qcasey authored Feb 2, 2023
1 parent 21276ba commit d1e55d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import PluginLoader from './domains/plugins/plugin-loader.svelte'
import { PluginStore } from './domains/plugins/PluginStore'
import Setup from './domains/setup/setup.svelte'
import locate from './modules/locate/locate'
// initiailze gestures
gestures()
Expand Down Expand Up @@ -157,6 +158,16 @@
wait(200).then(() => {
hideSplashScreen()
})
/**
* Fetch location onload if configured
* This caches a location to speed up Log creation on some mobile devices
*/
if ($Prefs.alwaysLocate) {
// Get the Location
locate().catch((e) => console.warn('Error fetching initial onload location', e))
}
Storage.init().then(async () => {
// await initGoals()
wait(2000).then(() => {
Expand Down

0 comments on commit d1e55d5

Please sign in to comment.