diff --git a/lib/ui/company_gateway/edit/company_gateway_edit.dart b/lib/ui/company_gateway/edit/company_gateway_edit.dart index 14f2ce402..c27452f9f 100644 --- a/lib/ui/company_gateway/edit/company_gateway_edit.dart +++ b/lib/ui/company_gateway/edit/company_gateway_edit.dart @@ -134,9 +134,11 @@ class _CompanyGatewayEditState extends State companyGateway.gatewayId == kGatewayStripeConnect) AppButton( label: localization.stripeConnect.toUpperCase(), - onPressed: () { - viewModel.onStripeConnectPressed(); - }, + onPressed: viewModel.state.isSaving + ? null + : () { + viewModel.onStripeConnectPressed(); + }, ) else GatewayConfigSettings( diff --git a/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart b/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart index 1c65fb95f..451597747 100644 --- a/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart +++ b/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart @@ -118,11 +118,15 @@ class CompanyGatewayEditVM { final credentials = state.credentials; final url = '${credentials.url}/one_time_token'; + store.dispatch(StartSaving()); + webClient.post(url, credentials.token).then((dynamic response) { + store.dispatch(StopSaving()); print('## RESPONSE: $response'); // TODO parse 'hash' //launch('${credentials.url}/stripe-connect/'); }).catchError((dynamic error) { + store.dispatch(StopSaving()); showErrorDialog( context: navigatorKey.currentContext, message: '$error'); });