-
Notifications
You must be signed in to change notification settings - Fork 2
fix: fix write down confirm screen #63
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package com.brainwallet.ui.screens.yourseedproveit | ||
|
||
data class YourSeedProveItState( | ||
val correctSeedWords: Map<String, String> = mapOf(), | ||
val correctSeedWords: Map<Int, SeedWordItem> = emptyMap(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this allow dupes @andhikayuana ? There can be duplicates in a seed phrase |
||
val shuffledSeedWords: List<String> = emptyList(), | ||
val orderCorrected: Boolean = false, | ||
) | ||
|
||
data class SeedWordItem( | ||
val expected: String, | ||
val actual: String = "" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.brainwallet.ui.screens.yourseedwords | ||
|
||
sealed class YourSeedWordsEvent { | ||
object OnSavedItClick : YourSeedWordsEvent() | ||
data class OnSavedItClick(val seedWords: List<String>) : YourSeedWordsEvent() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
package com.brainwallet.ui.screens.yourseedwords | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.brainwallet.navigation.Route | ||
import com.brainwallet.navigation.UiEffect | ||
import com.brainwallet.ui.BrainwalletViewModel | ||
import com.brainwallet.util.EventBus | ||
import kotlinx.coroutines.launch | ||
|
||
class YourSeedWordsViewModel : BrainwalletViewModel<YourSeedWordsEvent>() { | ||
|
||
override fun onEvent(event: YourSeedWordsEvent) { | ||
when (event) { | ||
YourSeedWordsEvent.OnSavedItClick -> viewModelScope.launch { | ||
EventBus.emit(EventBus.Event.Message(LEGACY_EFFECT_ON_SAVED_PAPERKEY)) | ||
is YourSeedWordsEvent.OnSavedItClick -> viewModelScope.launch { | ||
sendUiEffect(UiEffect.Navigate(destinationRoute = Route.YourSeedProveIt(event.seedWords))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andhikayuana thanks for the quick turn around but all of these changes are in the screens before the error occurs (YourSeedProveIt). Can you explain how this fixes the problem? |
||
} | ||
} | ||
} | ||
|
||
companion object { | ||
const val LEGACY_EFFECT_ON_SAVED_PAPERKEY = "onSavedPaperKey" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
@andhikayuana to be clear, the 12 seed words do not have to be unique....there can be duplicates.