SP Enhancments (#1483)

* fixes and minor enhancements for SP flow

* fix build

* change dfx text

* minor fixes

* pass use electrs to setListeners

* comment out connecting on failure for now
This commit is contained in:
Omar Hatem
2024-06-10 09:30:58 +02:00
committed by GitHub
parent 1dd2c7da56
commit 5a6502a35a
30 changed files with 86 additions and 68 deletions
+10 -4
View File
@@ -306,7 +306,7 @@ class CWBitcoin extends Bitcoin {
}
final electrumClient = ElectrumClient();
await electrumClient.connectToUri(node.uri);
await electrumClient.connectToUri(node.uri, useSSL: node.useSSL);
late BasedUtxoNetwork network;
btc.NetworkType networkType;
@@ -560,10 +560,16 @@ class CWBitcoin extends Bitcoin {
}
final bitcoinWallet = wallet as ElectrumWallet;
final tweaksResponse = await bitcoinWallet.electrumClient.getTweaks(height: 0);
try {
final tweaksResponse = await bitcoinWallet.electrumClient.getTweaks(height: 0);
if (tweaksResponse != null) {
return true;
if (tweaksResponse != null) {
return true;
}
} on RequestFailedTimeoutException {
return false;
} catch (_) {
rethrow;
}
return false;
+5 -3
View File
@@ -136,9 +136,11 @@ class RootState extends State<Root> with WidgetsBindingObserver {
break;
case AppLifecycleState.resumed:
widget.authService.requireAuth().then((value) {
setState(() {
_requestAuth = value;
});
if (mounted) {
setState(() {
_requestAuth = value;
});
}
});
break;
default:
+21 -19
View File
@@ -118,25 +118,27 @@ class ExceptionHandler {
WidgetsBinding.instance.addPostFrameCallback(
(timeStamp) async {
await showPopUp<void>(
context: navigatorKey.currentContext!,
builder: (context) {
return AlertWithTwoActions(
isDividerExist: true,
alertTitle: S.of(context).error,
alertContent: S.of(context).error_dialog_content,
rightButtonText: S.of(context).send,
leftButtonText: S.of(context).do_not_send,
actionRightButton: () {
Navigator.of(context).pop();
_sendExceptionFile();
},
actionLeftButton: () {
Navigator.of(context).pop();
},
);
},
);
if (navigatorKey.currentContext != null) {
await showPopUp<void>(
context: navigatorKey.currentContext!,
builder: (context) {
return AlertWithTwoActions(
isDividerExist: true,
alertTitle: S.of(context).error,
alertContent: S.of(context).error_dialog_content,
rightButtonText: S.of(context).send,
leftButtonText: S.of(context).do_not_send,
actionRightButton: () {
Navigator.of(context).pop();
_sendExceptionFile();
},
actionLeftButton: () {
Navigator.of(context).pop();
},
);
},
);
}
_hasError = false;
},