Skip to content

Commit b0eb30f

Browse files
committed
fix: display success toast on mnemonic copied
1 parent 34af53e commit b0eb30f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/src/main/java/to/bitkit/ui/settings/backups/ShowMnemonicScreen.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import kotlinx.coroutines.delay
4141
import kotlinx.coroutines.launch
4242
import to.bitkit.R
4343
import to.bitkit.ext.setClipboardText
44+
import to.bitkit.models.Toast
4445
import to.bitkit.ui.components.BodyM
4546
import to.bitkit.ui.components.BodyS
4647
import to.bitkit.ui.components.BottomSheetPreview
@@ -49,6 +50,7 @@ import to.bitkit.ui.components.PrimaryButton
4950
import to.bitkit.ui.components.SheetSize
5051
import to.bitkit.ui.scaffold.SheetTopBar
5152
import to.bitkit.ui.shared.modifiers.sheetHeight
53+
import to.bitkit.ui.shared.toast.ToastEventBus
5254
import to.bitkit.ui.shared.util.gradientBackground
5355
import to.bitkit.ui.theme.AppThemeSurface
5456
import to.bitkit.ui.theme.Colors
@@ -62,12 +64,20 @@ fun ShowMnemonicScreen(
6264
onContinueClick: () -> Unit,
6365
) {
6466
val context = LocalContext.current
67+
val scope = rememberCoroutineScope()
6568
ShowMnemonicContent(
6669
mnemonic = uiState.bip39Mnemonic,
6770
showMnemonic = uiState.showMnemonic,
6871
onRevealClick = onRevealClick,
6972
onCopyClick = {
7073
context.setClipboardText(uiState.bip39Mnemonic)
74+
scope.launch {
75+
ToastEventBus.send(
76+
type = Toast.ToastType.SUCCESS,
77+
title = context.getString(R.string.common__copied),
78+
description = context.getString(R.string.security__mnemonic_copied),
79+
)
80+
}
7181
},
7282
onContinueClick = onContinueClick,
7383
)

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
<string name="security__mnemonic_never_share">&lt;accent&gt;Never share&lt;/accent&gt; your recovery phrase with anyone as this may result in the loss of funds.</string>
467467
<string name="security__mnemonic_confirm">Confirm Recovery Phrase</string>
468468
<string name="security__mnemonic_confirm_tap">Tap the 12 words in the correct order.</string>
469+
<string name="security__mnemonic_copied">Mnemonic copied to clipboard</string>
469470
<string name="security__mnemonic_result_header">Successful</string>
470471
<string name="security__mnemonic_result_text">Make sure you store your recovery phrase in a &lt;accent&gt;secure place&lt;/accent&gt;, as this is the &lt;accent&gt;only way to recover&lt;/accent&gt; your money!</string>
471472
<string name="security__mnemonic_keep_header">Keep It Safe</string>

0 commit comments

Comments
 (0)