Skip to content

Commit

Permalink
[Feat] sopt-makers#149 - 닉네임 변경 시 UserDefault에 저장
Browse files Browse the repository at this point in the history
  • Loading branch information
L-j-h-c committed Apr 16, 2023
1 parent 7070fa3 commit 700090e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ extension SettingRepository: SettingRepositoryInterface {
return userService.changeNickname(nickname: nickname)
.map { _ in true }
.replaceError(with: false)
.handleEvents(receiveOutput: { isSuccessed in
guard isSuccessed else { return }
UserDefaultKeyList.User.soptampName = nickname
})
.eraseToAnyPublisher()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ extension MainVC {
self.collectionView.register(AppServiceCVC.self, forCellWithReuseIdentifier: AppServiceCVC.className)
}

private func pushSoptampFeature() {
private func presentSoptampFeature() {
let vc = factory.makeMissionListVC(sceneType: .default).viewController
navigationController?.pushViewController(vc, animated: true)
let nav = UINavigationController(rootViewController: vc)
nav.modalPresentationStyle = .fullScreen
present(nav, animated: true)
}

private func pushSettingFeature() {
Expand All @@ -140,10 +142,9 @@ extension MainVC {

extension MainVC: UICollectionViewDelegate {
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// TODO: - 디버깅을 위한 임시 솝탬프 피쳐 연결
if indexPath.section == 3 {
guard viewModel.userType != .visitor else { return }
pushSoptampFeature()
presentSoptampFeature()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
window = UIWindow(frame: scene.coordinateSpace.bounds)
window?.windowScene = scene
// let rootVC = container.makeShowAttendanceVC().viewController
let rootVC = container.makeSettingVC().viewController
let rootVC = container.makeMainVC(userType: .active).viewController
window?.rootViewController = UINavigationController(rootViewController: rootVC)
window?.makeKeyAndVisible()
}
Expand Down

0 comments on commit 700090e

Please sign in to comment.