Skip to content

Commit

Permalink
🐛 Home 자동 Refresh가 여정 기록중일때만 동작하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftyJunnos committed Dec 13, 2023
1 parent 7728892 commit 331f063
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public final class HomeViewController: HomeBottomSheetViewController {
super.viewDidAppear(animated)

// 화면 시작 시 새로고침 버튼 기능 한번 실행
self.refreshButton.sendActions(for: .touchUpInside)
if !self.viewModel.state.isRecording.value {
self.refreshButton.sendActions(for: .touchUpInside)
}
}

// MARK: - Combine Binding
Expand Down
11 changes: 9 additions & 2 deletions iOS/MSData/Sources/MSData/Repository/UserRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ public struct UserRepositoryImplementation: UserRepository {
let result = await self.networking.request(UserResponseDTO.self, router: router)
switch result {
case .success(let userResponse):
#if DEBUG
MSLogger.make(category: .network).debug("서버에 새로운 유저를 생성했습니다.")
#endif
if let storedUserID = try? self.storeUUID(userID) {
return .success(storedUserID)
} else {
MSLogger.make(category: .keychain).warning("Keychain에 새로운 유저 정보를 저장하지 못했습니다.")
return .success(userResponse.userID)
}
MSLogger.make(category: .keychain).warning("서버에 새로운 유저를 생성했지만, Keychain에 저장하지 못했습니다.")
return .success(userResponse.userID)
case .failure(let error):
return .failure(error)
}
Expand All @@ -73,6 +77,9 @@ public struct UserRepositoryImplementation: UserRepository {

do {
try self.keychain.set(value: userID, account: account)
#if DEBUG
MSLogger.make(category: .keychain).debug("Keychain에 서버 정보를 저장했습니다.")
#endif
return userID
} catch {
throw MSKeychainStorage.KeychainError.creationError
Expand Down

0 comments on commit 331f063

Please sign in to comment.