mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
fix(native): first visits no longer wait behind the offline warm-up, day rail follows the swipe
The iOS app pulls every file of a build into WebKit's cache so it can start offline. It did so four at a time at normal priority, for all 1,900 files of every new build including all 27 translations, and a page opened meanwhile queued behind it: right after a server update, a first visit to Vacay took five to seven seconds. The warm-up now runs two at a time at low priority, takes only the user's language and English, and walks a build once. The day rail in the trip header lit the new day only after the pager's snap had landed and the plan had re-rendered, a second or two after the swipe. The pager now reports the day a swipe heads for as soon as its page is the nearer one, and the rail and its pill move with the finger; the plan still switches when the snap lands.
This commit is contained in:
@@ -3,6 +3,7 @@ import { Keyboard } from '@capacitor/keyboard';
|
||||
import { SplashScreen } from '@capacitor/splash-screen';
|
||||
import { StatusBar, Style } from '@capacitor/status-bar';
|
||||
import { closeTopOverlay } from '../mobile/overlayStack';
|
||||
import { useSettingsStore } from '../store/settingsStore';
|
||||
import { isEffectivelyOffline } from '../sync/networkMode';
|
||||
import { checkAppUpdate, loadNativeCapabilities } from './capabilities';
|
||||
import { installNativeGeolocation } from './geolocation';
|
||||
@@ -64,7 +65,7 @@ export function startNativeApp(): void {
|
||||
if (isEffectivelyOffline()) return;
|
||||
// Not refreshed this time is no harm: the next launch tries again. An app
|
||||
// older than the offline copy has no such method, which is no failure.
|
||||
keepOfflineShellFresh().catch((err: unknown) => {
|
||||
keepOfflineShellFresh(fetch, useSettingsStore.getState().settings.language).catch((err: unknown) => {
|
||||
if (!isUnimplemented(err)) reportNativeFailure(err);
|
||||
});
|
||||
}, OFFLINE_SHELL_DELAY_MS);
|
||||
|
||||
Reference in New Issue
Block a user