Skip to content

Commit dd77cc2

Browse files
committed
πŸ› [fix] μ•± μž¬μ‹€ν–‰ μ‹œ μ‚¬μš©μžκ°€ μ„ νƒν•œ μ£Όμ†Œλ‘œ μ„€μ •λ˜μ§€ μ•Šλ˜ 문제 κ°œμ„ 
- μ‚¬μš©μžκ°€ μ„ νƒν•œ μ£Όμ†Œκ°€ μ‘΄μž¬ν•œλ‹€λ©΄ ν•΄λ‹Ή μ£Όμ†Œλ‘œ 메인화면을 μ„€μ •ν•˜λ„λ‘ κ°œμ„ 
1 parent 3dbfb3a commit dd77cc2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

β€ŽFitfty/Projects/Core/Sources/Utilities/UserManager.swiftβ€Ž

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,18 @@ extension DefaultUserManager: UserManager {
9595
}
9696

9797
public func fetchCurrentLocation() {
98-
LocationManager.shared.currentLocation()
99-
.compactMap { $0 }
100-
.map { ($0.coordinate.longitude, $0.coordinate.latitude )}
101-
.sink(receiveValue: { [weak self] (longitude: Double, latitude: Double) in
102-
self?._location.send((longitude, latitude))
103-
}).store(in: &cancellables)
98+
if let location = localStorage.read(key: .currentLocation) as? [String: Any] {
99+
let x = Double(location["x"] as? String ?? "126.977829174031") ?? 126.977829174031
100+
let y = Double(location["y"] as? String ?? "37.5663174209601") ?? 37.5663174209601
101+
_location.send((x, y))
102+
} else {
103+
LocationManager.shared.currentLocation()
104+
.compactMap { $0 }
105+
.map { ($0.coordinate.longitude, $0.coordinate.latitude )}
106+
.sink(receiveValue: { [weak self] (longitude: Double, latitude: Double) in
107+
self?._location.send((longitude, latitude))
108+
}).store(in: &cancellables)
109+
}
104110
Task {
105111
_guestState.send(await SessionManager.shared.checkUserSession())
106112
}

0 commit comments

Comments
Β (0)