Skip to content

Commit

Permalink
fix(LocationAuthButton): Don't flash in at startup (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaBrady authored Oct 30, 2024
1 parent a41baa5 commit a80b487
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions iosApp/iosApp/ComponentViews/LocationAuthButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ struct LocationAuthButton: View {
)
}
)
case .authorizedAlways, .authorizedWhenInUse:
case .authorizedAlways, .authorizedWhenInUse, nil:
EmptyView()
@unknown default:
Text("Location access state unknown")
EmptyView()
}
}
}
12 changes: 7 additions & 5 deletions iosApp/iosApp/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,7 @@
}
},
"Location access denied or restricted" : {
"extractionState" : "stale",
"localizations" : {
"es" : {
"stringUnit" : {
Expand Down Expand Up @@ -2565,6 +2566,7 @@
}
},
"Location access state unknown" : {
"extractionState" : "stale",
"localizations" : {
"es" : {
"stringUnit" : {
Expand Down Expand Up @@ -2739,15 +2741,15 @@
}
}
},
"Nearby Transit" : {
"comment" : "Header for nearby transit sheet"
},
"Monday through Friday: 6:30 AM - 8 PM" : {
"comment" : "Footnote under the More page support header, these are the hours for the support call center"
},
"mTicket App" : {
"comment" : "Footnote underneath the \"Commuter Rail and Ferry tickets\" label on the More page link to the MBTA mTicket app"
},
"Nearby Transit" : {
"comment" : "Header for nearby transit sheet"
},
"Next stop" : {
"comment" : "Label for a vehicle's next stop. For example: Next stop Alewife",
"localizations" : {
Expand Down Expand Up @@ -3265,6 +3267,7 @@
}
},
"Settings" : {
"comment" : "More page section header, includes settings that the user can configure",
"localizations" : {
"es" : {
"stringUnit" : {
Expand Down Expand Up @@ -3302,8 +3305,7 @@
"value" : "設定"
}
}
},
"comment" : "More page section header, includes settings that the user can configure"
}
},
"Severe Weather" : {
"comment" : "Possible alert cause",
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/LocationDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
public class LocationDataManager: NSObject, LocationFetcherDelegate, ObservableObject {
var locationFetcher: LocationFetcher
@Published public var currentLocation: CLLocation?
@Published public var authorizationStatus = CLAuthorizationStatus.notDetermined
@Published public var authorizationStatus: CLAuthorizationStatus?

public init(
locationFetcher: LocationFetcher = CLLocationManager(),
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosAppTests/LocationDataManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class LocationDataManagerTests: XCTestCase {

let manager = LocationDataManager(locationFetcher: locationFetcher)

XCTAssertEqual(manager.authorizationStatus, .notDetermined)
XCTAssertEqual(manager.authorizationStatus, nil)
XCTAssertNil(manager.currentLocation)
XCTAssertIdentical(manager, locationFetcher.locationFetcherDelegate)

Expand Down

0 comments on commit a80b487

Please sign in to comment.