Skip to content

Commit

Permalink
submitting tx spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Dec 23, 2023
1 parent 64d5406 commit 8cd2dca
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ android {
applicationId "io.runonflux.sspkey"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 6
versionCode 7
versionName "1.0.1"
}
signingConfigs {
Expand Down
31 changes: 27 additions & 4 deletions src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function Home({ navigation }: Props) {
(state) => state[activeChain],
);
const [activityStatus, setActivityStatus] = useState(false);
const [submittingTransaction, setSubmittingTransaction] = useState(false);

const { newTx, clearTx } = useSocket();

Expand Down Expand Up @@ -436,7 +437,7 @@ function Home({ navigation }: Props) {
) => {
try {
console.log('tx request');
// todo enable spinner here
setSubmittingTransaction(true);
const id = await getUniqueId();
const password = await EncryptedStorage.getItem('ssp_key_pw');
const pwForEncryption = id + password;
Expand Down Expand Up @@ -495,7 +496,7 @@ function Home({ navigation }: Props) {
displayMessage('error', t('home:err_tx_failed'));
console.log(error);
} finally {
console.log('all done. todo Disable spinner');
setSubmittingTransaction(false);
}
};
const handleManualInput = async (manualInput: string) => {
Expand Down Expand Up @@ -782,7 +783,29 @@ function Home({ navigation }: Props) {
Layout.colCenter,
]}
>
{!rawTx && !syncReq && (
{submittingTransaction && (
<View
style={[
Layout.fill,
Layout.relative,
Layout.fullWidth,
Layout.justifyContentCenter,
Layout.alignItemsCenter,
]}
>
<Icon name="send" size={60} color={Colors.textGray400} />
<Text
style={[Fonts.textBold, Fonts.textRegular, Gutters.smallMargin]}
>
{t('home:submitting_transaction')}
</Text>
<ActivityIndicator
size={'large'}
style={[Layout.row, Gutters.regularVMargin, { height: 30 }]}
/>
</View>
)}
{!submittingTransaction && !rawTx && !syncReq && (
<>
<View
style={[
Expand Down Expand Up @@ -873,7 +896,7 @@ function Home({ navigation }: Props) {
</View>
</>
)}
{rawTx && xpubWallet && xpubKey && (
{!submittingTransaction && rawTx && xpubWallet && xpubKey && (
<TransactionRequest
rawTx={rawTx}
chain={activeChain as keyof cryptos}
Expand Down
3 changes: 2 additions & 1 deletion src/translations/resources/en/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
"select_chain": "Select Chain",
"selected_chain": "Selected Chain",
"selected_chain_wallet":"Selected Chain and Wallet",
"chain_not_synced_scan": "Chain Not Synced with SSP Wallet. Scan SSP Wallet QR Code to Sync it."
"chain_not_synced_scan": "Chain Not Synced with SSP Wallet. Scan SSP Wallet QR Code to Sync it.",
"submitting_transaction": "Submitting Transaction..."
}

0 comments on commit 8cd2dca

Please sign in to comment.