mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
disable checking trade history for updates in incognito mode
This commit is contained in:
parent
8664699484
commit
e1e9cb7126
2 changed files with 19 additions and 15 deletions
|
@ -79,23 +79,25 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
transactionIfSentFromStack = widget.transactionIfSentFromStack;
|
transactionIfSentFromStack = widget.transactionIfSentFromStack;
|
||||||
walletId = widget.walletId;
|
walletId = widget.walletId;
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||||
final trade = ref
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
.read(tradesServiceProvider)
|
final trade = ref
|
||||||
.trades
|
.read(tradesServiceProvider)
|
||||||
.firstWhere((e) => e.tradeId == tradeId);
|
.trades
|
||||||
|
.firstWhere((e) => e.tradeId == tradeId);
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
final exchange = Exchange.fromName(trade.exchangeName);
|
final exchange = Exchange.fromName(trade.exchangeName);
|
||||||
final response = await exchange.updateTrade(trade);
|
final response = await exchange.updateTrade(trade);
|
||||||
|
|
||||||
if (mounted && response.value != null) {
|
if (mounted && response.value != null) {
|
||||||
await ref
|
await ref
|
||||||
.read(tradesServiceProvider)
|
.read(tradesServiceProvider)
|
||||||
.edit(trade: response.value!, shouldNotifyListeners: true);
|
.edit(trade: response.value!, shouldNotifyListeners: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,9 @@ class NotificationsService extends ChangeNotifier {
|
||||||
_timer = Timer.periodic(notificationRefreshInterval, (_) {
|
_timer = Timer.periodic(notificationRefreshInterval, (_) {
|
||||||
Logging.instance
|
Logging.instance
|
||||||
.log("Periodic notifications update check", level: LogLevel.Info);
|
.log("Periodic notifications update check", level: LogLevel.Info);
|
||||||
_checkTrades();
|
if (prefs.externalCalls) {
|
||||||
|
_checkTrades();
|
||||||
|
}
|
||||||
_checkTransactions();
|
_checkTransactions();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue