Skip to content

Commit 5851569

Browse files
committed
feat(currencycreator): handle proto validation errors the same as flagged or denied
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 9912196 commit 5851569

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/flipcash/features/currency-creator/src/main/kotlin/com/flipcash/app/currencycreator/internal/CurrencyCreatorViewModel.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import com.getcode.opencode.internal.solana.model.SwapId
4141
import com.getcode.opencode.model.core.errors.CheckTokenAvailabilityError
4242
import com.getcode.opencode.model.core.errors.GetMintsError
4343
import com.getcode.opencode.model.core.errors.LaunchTokenError
44+
import com.getcode.opencode.model.core.errors.ValidationException
4445
import com.getcode.opencode.model.financial.MintMetadata
4546
import com.getcode.opencode.model.financial.Token
4647
import com.getcode.opencode.model.financial.TokenCreateRequest
@@ -280,6 +281,7 @@ internal class CurrencyCreatorViewModel @Inject constructor(
280281
onError = { cause ->
281282
dispatchEvent(Event.UpdateProcessingState())
282283
when (cause) {
284+
is ValidationException,
283285
is TextModerationError.Flagged,
284286
is TextModerationError.Denied -> {
285287
BottomBarManager.showAlert(
@@ -330,6 +332,7 @@ internal class CurrencyCreatorViewModel @Inject constructor(
330332
dispatchEvent(Event.UpdateProcessingState())
331333
stateFlow.value.icon.dataOrNull?.let { contentReader.removeFromCache(it) }
332334
when (cause) {
335+
is ValidationException,
333336
is ImageModerationError.Flagged,
334337
is ImageModerationError.Denied -> {
335338
BottomBarManager.showAlert(
@@ -379,6 +382,7 @@ internal class CurrencyCreatorViewModel @Inject constructor(
379382
onError = { cause ->
380383
dispatchEvent(Event.UpdateProcessingState())
381384
when (cause) {
385+
is ValidationException,
382386
is TextModerationError.Flagged,
383387
is TextModerationError.Denied -> {
384388
BottomBarManager.showAlert(

0 commit comments

Comments
 (0)