Skip to content
Merged
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
10 changes: 0 additions & 10 deletions core/ui/src/main/kotlin/com/afternote/core/ui/UiText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ sealed interface UiText {
val value: String,
) : UiText

/** 서버/예외가 메시지를 주면 그대로, 없으면 리소스 fallback. `e.message ?: getString(R.string.x)` 대응. */
data class DynamicOrResource(
val value: String?,
@param:StringRes val fallbackResId: Int,
) : UiText

companion object {
fun resource(
@StringRes resId: Int,
Expand All @@ -50,8 +44,4 @@ fun UiText.asString(): String =
is UiText.Dynamic -> {
value
}

is UiText.DynamicOrResource -> {
value ?: stringResource(fallbackResId)
}
}
Loading