Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELEASE] 3.1.0 version 배포 #247

Merged
merged 13 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 3 additions & 63 deletions Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum SmeemError: Error {
case clientError
case serverError
case unknwnError
case tokenError

var displayText: String {
switch self {
Expand All @@ -65,6 +66,8 @@ enum SmeemError: Error {
return "데이터를 불러올 수 없어요 :("
case .unknwnError:
return "문제가 발생했어요. 다시 접속해 주세요. :("
case .tokenError:
return "다시 로그인해 주세요. :("
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class NavigationBarFactory {
.withLayout(type.layout)
.build()
navigationBar.applyConfiguraton(configuration)
// navigationBar.actionDelegate = DetailDiaryViewController()
return navigationBar
case .edit:
let configuration = configurationBuilder
Expand Down
4 changes: 3 additions & 1 deletion Smeem-iOS/Smeem-iOS/Network/Base/NetworkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import Foundation
final class NetworkManager {
static func statusCodeErrorHandling(statusCode: Int) throws {
switch statusCode {
case 400..<500:
case 400, 402..<500:
throw SmeemError.clientError
case 401:
throw SmeemError.tokenError
case 500...:
throw SmeemError.serverError
default:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,111 +42,122 @@ struct DetailDiaryCoachedView: View {
// MARK: - Body

var body: some View {
VStack(spacing: 0) {
SwiftUINavigationView(navigationViewModel: navigationViewModel,
selectedIndex: $selectedIndex,
navigationbarType: navigationbarType
)
.onReceive(navigationViewModel.leftButtonTapped) {
dismiss()
}
.onReceive(navigationViewModel.rightButtonTapped) {
isShowingFloatingButtons = true
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_edit(hasCorrections).event)
}
.confirmationDialog("", isPresented: $isShowingFloatingButtons) {
Button("수정하기", role: .none) {
if navigationbarType == .diaryDetails {
showEditConfirmation(
title: "수정 확인",
message: "수정시 모든 코칭 내용이 사라집니다. 그래도 수정하시겠습니까?",
firstActionTitle: "취소",
secondActionTitle: "확인",
firstActionHandler: { },
secondActionHandler: {
navigateToEditDiary()
}
)
} else {
navigateToEditDiary()
ZStack {
Color.white.ignoresSafeArea()
VStack(spacing: 0) {
SwiftUINavigationView(navigationViewModel: navigationViewModel,
selectedIndex: $selectedIndex,
navigationbarType: navigationbarType
)
.onReceive(navigationViewModel.leftButtonTapped) {
dismiss()
}
.onReceive(navigationViewModel.rightButtonTapped) {
isShowingFloatingButtons = true
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_edit(hasCorrections).event)
}
.confirmationDialog("", isPresented: $isShowingFloatingButtons) {
Button("수정하기", role: .none) {
if navigationbarType == .diaryDetails {
showEditConfirmation(
title: "수정 확인",
message: "수정시 모든 코칭 내용이 사라집니다. 그래도 수정하시겠습니까?",
firstActionTitle: "취소",
secondActionTitle: "확인",
firstActionHandler: { },
secondActionHandler: {
navigateToEditDiary()
}
)
} else {
navigateToEditDiary()
}
}

Button("삭제하기", role: .destructive) {
deleteDiaryWithAPI(diaryID: diaryID ?? 0)
}

Button("취소", role: .cancel) {
isShowingFloatingButtons = false
}
}

Button("삭제하기", role: .destructive) {
deleteDiaryWithAPI(diaryID: diaryID ?? 0)
if let topic = response?.topic {
if topic != "" {
RandomTopicViewSwiftUI(contentText: response?.topic)
}
}

Button("취소", role: .cancel) {
isShowingFloatingButtons = false
if let response = response {
ScrollableDiaryView(
diaryText: response.content,
corrections: filteredCorrections,
currentIndex: currentIndex,
selectedIndex: selectedIndex,
dateText: response.createdAt,
authorText: response.username
)
} else {
if isLoading {
SmemeEmptyView()
SmemeLoadingView()
}
}

// "코칭 ON"일 때만 표시
if selectedIndex == 1 {
Spacer()
CoachingContentView(
currentIndex: $currentIndex,
detailDiaryResponse: Binding(
get: { self.response ?? .empty },
set: { _ in }
),
corrections: $filteredCorrections
)
} else {
Spacer()
}
}

if let topic = response?.topic {
if topic != "" {
RandomTopicViewSwiftUI(contentText: response?.topic)
.onAppear {
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_click(true).event)
Task {
await fetchCoachingData(diaryID: diaryID ?? 0)
}
}

if let response = response {
ScrollableDiaryView(
diaryText: response.content,
corrections: filteredCorrections,
currentIndex: currentIndex,
selectedIndex: selectedIndex,
dateText: response.createdAt,
authorText: response.username
.onChange(of: selectedIndex) { newValue in
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.toggle_click(convertSelectedIndexToString(newValue)).event
)
} else {
}
.overlay {
if isLoading {
SmemeEmptyView()
SmemeLoadingView()
}
}

// "코칭 ON"일 때만 표시
if selectedIndex == 1 {
Spacer()
CoachingContentView(
currentIndex: $currentIndex,
detailDiaryResponse: Binding(
get: { self.response ?? .empty },
set: { _ in }
),
corrections: $filteredCorrections
)
} else {
Spacer()

if onError {
ZStack {
Color.clear
VStack {
Spacer()
SmeemErrorToastView(type: $toastErrorMessage)
.padding(.bottom, 20.scaledByHeight())
}
}
}
.onAppear {
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_click(hasCorrections).event)
Task {
await fetchCoachingData(diaryID: diaryID ?? 0)
}
}
.onChange(of: selectedIndex) { newValue in
AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.toggle_click(convertSelectedIndexToString(newValue)).event
)
}
.overlay {
if isLoading {
SmemeEmptyView()
SmemeLoadingView()
}

if onError {
ZStack {
Color.clear
VStack {
Spacer()
SmeemErrorToastView(type: $toastErrorMessage)
.padding(.bottom, 20.scaledByHeight())
.onDisappear {
onError = false
}
}
.onDisappear {
onError = false
}
}
.gesture(
DragGesture()
.onEnded { value in
if value.translation.width > 50 {
dismiss()
}
}
)
}
}
}
Expand Down Expand Up @@ -205,7 +216,6 @@ extension DetailDiaryCoachedView {
self.changeRootViewControllerAndPresent(homeVC)
case .failure(let error):
toastErrorMessage = error
break
}
isLoading = false
}
Expand Down
Loading