diff --git a/iOS/Features/Home/Sources/Home/Presentation/HomeViewModel.swift b/iOS/Features/Home/Sources/Home/Presentation/HomeViewModel.swift index 9518e06..45d3d61 100644 --- a/iOS/Features/Home/Sources/Home/Presentation/HomeViewModel.swift +++ b/iOS/Features/Home/Sources/Home/Presentation/HomeViewModel.swift @@ -103,8 +103,12 @@ public final class HomeViewModel { private extension HomeViewModel { + private var shouldSignIn: Bool { + return self.isFirstLaunch || self.userRepository.fetchUUID() == nil + } + func createNewUserWhenFirstLaunch() { - guard self.isFirstLaunch else { return } + guard self.shouldSignIn else { return } Task { let result = await self.userRepository.createUser() diff --git a/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift b/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift index edcf843..fece4c9 100644 --- a/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift +++ b/iOS/Features/Home/Sources/NavigateMap/Presentation/Common/MapViewController.swift @@ -250,11 +250,7 @@ public final class MapViewController: UIViewController { CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude) } - let spotCoordinates = journey.spots.map { - CLLocationCoordinate2D(latitude: $0.coordinate.latitude, - longitude: $0.coordinate.longitude) - } - await self.drawPolylineToMap(using: coordinates+spotCoordinates) + await self.drawPolylineToMap(using: coordinates) } } } diff --git a/iOS/MSCoreKit/Sources/MSKeychainStorage/MSKeychainStorage+Constants.swift b/iOS/MSCoreKit/Sources/MSKeychainStorage/MSKeychainStorage+Constants.swift index 1c3dfb1..df59054 100644 --- a/iOS/MSCoreKit/Sources/MSKeychainStorage/MSKeychainStorage+Constants.swift +++ b/iOS/MSCoreKit/Sources/MSKeychainStorage/MSKeychainStorage+Constants.swift @@ -17,7 +17,7 @@ extension MSKeychainStorage { public enum Accounts: String, CaseIterable { - case userID + case userID = "MusicSpotUser.v1" } diff --git a/iOS/MSUIKit/Sources/MSUIKit/Cells/JourneyCell/JourneyCell.swift b/iOS/MSUIKit/Sources/MSUIKit/Cells/JourneyCell/JourneyCell.swift index 4b5b148..73d2cd3 100644 --- a/iOS/MSUIKit/Sources/MSUIKit/Cells/JourneyCell/JourneyCell.swift +++ b/iOS/MSUIKit/Sources/MSUIKit/Cells/JourneyCell/JourneyCell.swift @@ -8,6 +8,7 @@ import UIKit import MSDesignSystem +import MSExtension import MSImageFetcher public final class JourneyCell: UICollectionViewCell { @@ -96,8 +97,7 @@ public final class JourneyCell: UICollectionViewCell { return } - let key = "\(indexPath.section)-\(indexPath.item)" - photoView.imageView.ms.setImage(with: imageURL, forKey: key) + photoView.imageView.ms.setImage(with: imageURL, forKey: imageURL.paath()) } } diff --git a/iOS/MusicSpot/MusicSpot/SceneDelegate.swift b/iOS/MusicSpot/MusicSpot/SceneDelegate.swift index 4956c04..da7a457 100644 --- a/iOS/MusicSpot/MusicSpot/SceneDelegate.swift +++ b/iOS/MusicSpot/MusicSpot/SceneDelegate.swift @@ -81,15 +81,15 @@ import MSKeychainStorage private extension SceneDelegate { func prepareToDebug() { -// self.isFirstLaunch = true -// self.recordingJourneyID = nil -// self.isRecording = false -// -// do { -// try self.keychain.deleteAll() -// } catch { -// MSLogger.make(category: .keychain).error("키체인 초기화 실패") -// } + self.isFirstLaunch = true + self.recordingJourneyID = nil + self.isRecording = false + + do { + try self.keychain.deleteAll() + } catch { + MSLogger.make(category: .keychain).error("키체인 초기화 실패") + } } }