Skip to content

Commit

Permalink
[Fix] #102 - exit API -> history API로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
meltsplit committed Jan 14, 2025
1 parent 4ea2193 commit 8f13837
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class FinishViewModel: ObservableObject {
case .alert(.exitRoom):
state.exitRoomAlertIsPresented = false

roomService.exitRoom(with: state.roomInfo.id)
roomService.deleteHistoryRoom(with: state.roomInfo.id)
.catch { _ in Empty() }
.receive(on: RunLoop.main)
.sink(receiveValue: { [weak self] _ in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct SplashView: View {
isPresented:
viewModel.state.serverCheckAlert.isPresented,
title: viewModel.state.serverCheckAlert.message,
primaryButton: ("확인 후 앱 닫기", {
exit(0)
primaryButton: ("확인", {
viewModel.send(.alert(.confirm))
})
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class SplashViewModel: ObservableObject {

enum Action {
case onAppear
case alert(Alert)
}


Expand All @@ -22,6 +23,10 @@ class SplashViewModel: ObservableObject {
var serverCheckAlert: (isPresented: Bool, message: String) = (false, "서버 점검 시간입니다")
}

enum Alert {
case confirm
}

//MARK: - Dependency

private let appService: AppServiceType
Expand Down Expand Up @@ -57,6 +62,7 @@ class SplashViewModel: ObservableObject {
weak var owner = self
guard let owner else { return }
switch action {

case .onAppear:

appService.isLatestVersion()
Expand Down Expand Up @@ -95,7 +101,8 @@ class SplashViewModel: ObservableObject {

}
.store(in: cancelBag)

case .alert(.confirm):
state.serverCheckAlert.isPresented = false


}
Expand Down

0 comments on commit 8f13837

Please sign in to comment.