Skip to content

Commit

Permalink
Merge pull request #5990 from bithyve/fix/transfer-policy
Browse files Browse the repository at this point in the history
fix transfer policy ui glitch
  • Loading branch information
ben-kaufman authored Feb 5, 2025
2 parents 02754c1 + 8fcd25e commit ad83793
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/screens/WalletDetails/WalletSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { VisibilityType } from 'src/services/wallets/enums';
import { WalletType } from 'src/services/wallets/enums';
import { captureError } from 'src/services/sentry';
import BackupModalContent from '../AppSettings/BackupModal';
import ActivityIndicatorView from 'src/components/AppActivityIndicator/ActivityIndicatorView';

function WalletSettings({ route }) {
const { colorMode } = useColorMode();
Expand All @@ -31,6 +32,7 @@ function WalletSettings({ route }) {
const [xpubVisible, setXPubVisible] = useState(false);
const [confirmPassVisible, setConfirmPassVisible] = useState(false);
const [transferPolicyVisible, setTransferPolicyVisible] = useState(editPolicy);
const [loadingState, setLoadingState] = useState(false);

const { wallets } = useWallets();
const wallet = wallets.find((item) => item.id === walletRoute.id);
Expand Down Expand Up @@ -64,6 +66,13 @@ function WalletSettings({ route }) {
}
};

const handleTransferPolicy = async () => {
setLoadingState(true);
await new Promise((resolve) => setTimeout(resolve, 2000));
setTransferPolicyVisible(true);
setLoadingState(false);
};

return (
<ScreenWrapper backgroundcolor={`${colorMode}.primaryBackground`}>
<KeeperHeader title={settings.walletSettings} subtitle={settings.walletSettingSubTitle} />
Expand Down Expand Up @@ -96,13 +105,13 @@ function WalletSettings({ route }) {
<OptionCard
title={walletTranslation.TransferPolicy}
description={walletTranslation.TransferPolicyDesc}
callback={() => {
setTransferPolicyVisible(true);
}}
callback={handleTransferPolicy}
/>
)}
{TestSatsComponent}
</ScrollView>
<ActivityIndicatorView visible={loadingState} showLoader />

<KeeperModal
visible={transferPolicyVisible}
close={() => {
Expand Down

0 comments on commit ad83793

Please sign in to comment.