mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
fix dialog popping up too often on desktop
This commit is contained in:
parent
66661a3f90
commit
5b61744124
2 changed files with 20 additions and 5 deletions
|
@ -399,7 +399,7 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
);
|
);
|
||||||
|
|
||||||
ref.read(pIsExchangeAddress.state).state =
|
ref.read(pIsExchangeAddress.state).state =
|
||||||
(coin as Firo).isExchangeAddress(_address ?? "");
|
(coin as Firo).isExchangeAddress(address ?? "");
|
||||||
|
|
||||||
if (ref.read(publicPrivateBalanceStateProvider) == FiroType.spark &&
|
if (ref.read(publicPrivateBalanceStateProvider) == FiroType.spark &&
|
||||||
ref.read(pIsExchangeAddress) &&
|
ref.read(pIsExchangeAddress) &&
|
||||||
|
|
|
@ -711,7 +711,17 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
);
|
);
|
||||||
|
|
||||||
ref.read(pIsExchangeAddress.state).state =
|
ref.read(pIsExchangeAddress.state).state =
|
||||||
(coin as Firo).isExchangeAddress(_address ?? "");
|
(coin as Firo).isExchangeAddress(address ?? "");
|
||||||
|
|
||||||
|
if (ref.read(publicPrivateBalanceStateProvider) == FiroType.spark &&
|
||||||
|
ref.read(pIsExchangeAddress) &&
|
||||||
|
!_isFiroExWarningDisplayed) {
|
||||||
|
_isFiroExWarningDisplayed = true;
|
||||||
|
showFiroExchangeAddressWarning(
|
||||||
|
context,
|
||||||
|
() => _isFiroExWarningDisplayed = false,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.read(pValidSendToAddress.notifier).state =
|
ref.read(pValidSendToAddress.notifier).state =
|
||||||
|
@ -952,8 +962,13 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
}
|
}
|
||||||
|
|
||||||
final firoType = ref.watch(publicPrivateBalanceStateProvider);
|
final firoType = ref.watch(publicPrivateBalanceStateProvider);
|
||||||
if (coin is Firo && firoType == FiroType.spark) {
|
|
||||||
if (ref.watch(pIsExchangeAddress) && !_isFiroExWarningDisplayed) {
|
final isExchangeAddress = ref.watch(pIsExchangeAddress);
|
||||||
|
ref.listen(publicPrivateBalanceStateProvider, (previous, next) {
|
||||||
|
if (previous != next &&
|
||||||
|
next == FiroType.spark &&
|
||||||
|
isExchangeAddress &&
|
||||||
|
!_isFiroExWarningDisplayed) {
|
||||||
_isFiroExWarningDisplayed = true;
|
_isFiroExWarningDisplayed = true;
|
||||||
WidgetsBinding.instance.addPostFrameCallback(
|
WidgetsBinding.instance.addPostFrameCallback(
|
||||||
(_) => showFiroExchangeAddressWarning(
|
(_) => showFiroExchangeAddressWarning(
|
||||||
|
@ -962,7 +977,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
final showCoinControl = ref.watch(
|
final showCoinControl = ref.watch(
|
||||||
prefsChangeNotifierProvider.select(
|
prefsChangeNotifierProvider.select(
|
||||||
|
|
Loading…
Reference in a new issue