Skip to content

Commit

Permalink
Merge pull request #457 from Corvus400/enhancement/migrate_app_string…
Browse files Browse the repository at this point in the history
…s_to_compose_multiplatform_resources

🔧 Migrate AppStrings to compose multiplatform resources.
  • Loading branch information
takahirom authored Aug 15, 2024
2 parents eb53a8d + b675bb0 commit a14a752
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sample">!!Please remove this resource when you add string resource!!</string>
<string name="retry">リトライ</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sample">!!Please remove this resource when you add string resource!!</string>
<string name="retry">Retry</string>
</resources>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package io.github.droidkaigi.confsched.ui

import io.github.droidkaigi.confsched.designsystem.strings.Strings
import io.github.droidkaigi.confsched.ui.UserMessageResult.ActionPerformed
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.retry

fun <T> Flow<T>.handleErrorAndRetry(
actionLabel: Strings<*>,
actionLabel: String,
userMessageStateHolder: UserMessageStateHolder,
) = retry { throwable ->
// TODO: Introduce logger
throwable.printStackTrace()
val messageResult = userMessageStateHolder.showMessage(
message = throwable.toApplicationErrorMessage(),
actionLabel = actionLabel.asString(),
actionLabel = actionLabel,
)

val retryPerformed = messageResult == ActionPerformed
Expand Down

0 comments on commit a14a752

Please sign in to comment.