Skip to content

Commit

Permalink
zz
Browse files Browse the repository at this point in the history
  • Loading branch information
taetae98coding committed Nov 7, 2024
1 parent b7440b7 commit 3c04760
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Diary/Diary/DiaryApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ struct DiaryApp: App {

var body: some Scene {
WindowGroup {
ContentView().ignoresSafeArea()
VStack {
if let info = Bundle.main.infoDictionary {
if let diaryApiUrl = info["Diary Api Url"] as? String {
Text(diaryApiUrl)
}
}

ContentView().ignoresSafeArea()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private fun Message(
uiState.isLoginFinish -> onLoginFinish()
uiState.isExistEmail -> state.showMessage(existEmailMessage)
uiState.isNetworkError -> state.showMessage(networkErrorMessage)
uiState.isUnknownError -> state.showMessage(unknownErrorMessage)
uiState.isUnknownError -> state.showMessage(uiState.message)
}

uiState.onMessageShow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal class JoinViewModel(
when (throwable) {
is ExistEmailException -> _uiState.update { it.copy(isProgress = false, isExistEmail = true) }
is NetworkException -> _uiState.update { it.copy(isProgress = false, isNetworkError = true) }
else -> _uiState.update { it.copy(isProgress = false, isUnknownError = true) }
else -> _uiState.update { it.copy(isProgress = false, isUnknownError = true, message = it.toString()) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ internal data class JoinUiState(
val isExistEmail: Boolean = false,
val isNetworkError: Boolean = false,
val isUnknownError: Boolean = false,
val message: String = "",
val onMessageShow: () -> Unit = {},
) {
val hasMessage = isLoginFinish || isExistEmail || isNetworkError || isUnknownError
Expand Down

0 comments on commit 3c04760

Please sign in to comment.