Skip to content

Commit

Permalink
fix: empty view at first launch
Browse files Browse the repository at this point in the history
  • Loading branch information
roland9 committed Nov 23, 2024
1 parent 7a26b8e commit 3332af7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions LuasWatch Watch App/Coordinator+LocationDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ extension Coordinator: LocationDelegate {
{
/// only use the cached trains list if they actually match the station we're about to load
/// (otherwise the UI looks wrong, e.g. might show the incorrect line color
updateWithAnimation(
to: .loadingDueTimes(
closestStation,
cachedTrains: cachedTrains.trains))

/// DON'T use updateWithAnimation() here, at first launch it shows empty content?!?
appModel.appState = .loadingDueTimes(
closestStation, cachedTrains: cachedTrains.trains)
} else {
updateWithAnimation(to: .loadingDueTimes(closestStation, cachedTrains: nil))

/// DON'T use updateWithAnimation() here, at first launch it shows empty content?!?
appModel.appState = .loadingDueTimes(
closestStation, cachedTrains: nil)
}
} else {
myPrint("SidebarView is up -> ignore so we don't interfere UI")
Expand Down

0 comments on commit 3332af7

Please sign in to comment.