mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-23 19:16:09 +00:00
CAKE-279 | added isRunningWebView to the dashboard_view_model.dart; applied isRunningWebView to call of WebViewPage in the dashboard_page.dart
This commit is contained in:
parent
d752692c3f
commit
af9d39f460
2 changed files with 24 additions and 14 deletions
|
@ -125,10 +125,14 @@ class DashboardPage extends BasePage {
|
|||
image: exchangeImage,
|
||||
title: S.of(context).exchange,
|
||||
route: Routes.exchange),
|
||||
if (walletViewModel.type == WalletType.bitcoin) ActionButton(
|
||||
if (walletViewModel.type == WalletType.bitcoin) Observer(
|
||||
builder: (_) => ActionButton(
|
||||
image: buyImage,
|
||||
title: S.of(context).buy,
|
||||
onClick: () async {
|
||||
onClick: walletViewModel.isRunningWebView
|
||||
? null
|
||||
: () async {
|
||||
walletViewModel.isRunningWebView = true;
|
||||
final url = await walletViewModel.getWyreUrl();
|
||||
if (url.isNotEmpty) {
|
||||
await Navigator.of(context)
|
||||
|
@ -140,7 +144,8 @@ class DashboardPage extends BasePage {
|
|||
await walletViewModel.saveOrder(orderId);
|
||||
}
|
||||
}
|
||||
}),
|
||||
walletViewModel.isRunningWebView = false;
|
||||
})),
|
||||
],
|
||||
)),
|
||||
)
|
||||
|
|
|
@ -93,6 +93,8 @@ abstract class DashboardViewModelBase with Store {
|
|||
]
|
||||
};
|
||||
|
||||
isRunningWebView = false;
|
||||
|
||||
name = appStore.wallet?.name;
|
||||
wallet ??= appStore.wallet;
|
||||
type = wallet.type;
|
||||
|
@ -177,6 +179,9 @@ abstract class DashboardViewModelBase with Store {
|
|||
@observable
|
||||
String subname;
|
||||
|
||||
@observable
|
||||
bool isRunningWebView;
|
||||
|
||||
@computed
|
||||
String get address => wallet.address;
|
||||
|
||||
|
|
Loading…
Reference in a new issue