mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-21 14:34:55 +01:00
Merge pull request #7024 from BlueWallet/Cant-use-full-balance-or-coin-control,-windows-are-not-modal-on-Mac-#7017
FIX: Cant use full balance or coin control, windows are not modal on …
This commit is contained in:
commit
a4c16a8d38
1 changed files with 25 additions and 27 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
ActivityIndicator,
|
||||
Alert,
|
||||
Dimensions,
|
||||
findNodeHandle,
|
||||
FlatList,
|
||||
I18nManager,
|
||||
Keyboard,
|
||||
|
@ -55,6 +56,7 @@ import { useStorage } from '../../hooks/context/useStorage';
|
|||
import { Action } from '../../components/types';
|
||||
import SelectFeeModal from '../../components/SelectFeeModal';
|
||||
import { useKeyboard } from '../../hooks/useKeyboard';
|
||||
import ActionSheet from '../ActionSheet';
|
||||
|
||||
interface IPaymentDestinations {
|
||||
address: string; // btc address or payment code
|
||||
|
@ -1081,34 +1083,30 @@ const SendDetails = () => {
|
|||
const onUseAllPressed = () => {
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
|
||||
const message = frozenBalance > 0 ? loc.send.details_adv_full_sure_frozen : loc.send.details_adv_full_sure;
|
||||
Alert.alert(
|
||||
loc.send.details_adv_full,
|
||||
|
||||
const anchor = findNodeHandle(scrollView.current);
|
||||
const options = {
|
||||
title: loc.send.details_adv_full,
|
||||
message,
|
||||
[
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
Keyboard.dismiss();
|
||||
setAddresses(addrs => {
|
||||
addrs[scrollIndex.current].amount = BitcoinUnit.MAX;
|
||||
addrs[scrollIndex.current].amountSats = BitcoinUnit.MAX;
|
||||
return [...addrs];
|
||||
});
|
||||
setUnits(u => {
|
||||
u[scrollIndex.current] = BitcoinUnit.BTC;
|
||||
return [...u];
|
||||
});
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
{
|
||||
text: loc._.cancel,
|
||||
onPress: () => {},
|
||||
style: 'cancel',
|
||||
},
|
||||
],
|
||||
{ cancelable: false },
|
||||
);
|
||||
options: [loc._.cancel, loc._.ok],
|
||||
cancelButtonIndex: 0,
|
||||
anchor: anchor ?? undefined,
|
||||
};
|
||||
|
||||
ActionSheet.showActionSheetWithOptions(options, buttonIndex => {
|
||||
if (buttonIndex === 1) {
|
||||
Keyboard.dismiss();
|
||||
setAddresses(addrs => {
|
||||
addrs[scrollIndex.current].amount = BitcoinUnit.MAX;
|
||||
addrs[scrollIndex.current].amountSats = BitcoinUnit.MAX;
|
||||
return [...addrs];
|
||||
});
|
||||
setUnits(u => {
|
||||
u[scrollIndex.current] = BitcoinUnit.BTC;
|
||||
return [...u];
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const formatFee = (fee: number) => formatBalance(fee, feeUnit!, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue