Skip to content

Commit

Permalink
fix: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Erdem Yerebasmaz <[email protected]>
  • Loading branch information
hydra-yse and erdemyerebasmaz authored Jan 8, 2025
1 parent 59ee156 commit ab0abfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cubit/webhook/webhook_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ class WebhookCubit extends Cubit<WebhookState> {
this._notifications,
) : super(WebhookState()) {
_breezSdkLiquid.walletInfoStream.first.then(
(GetInfoResponse getInfoResponse) => refreshLnurlPay(getInfoResponse: getInfoResponse),
(WalletInfo walletInfo) => refreshLnurlPay(walletInfo: getInfoResponse.walletInfo),
);
}

Future<void> refreshLnurlPay({GetInfoResponse? getInfoResponse}) async {
Future<void> refreshLnurlPay({WalletInfo? walletInfo}) async {
_logger.info('Refreshing Lightning Address');
emit(WebhookState(isLoading: true));
try {
getInfoResponse = getInfoResponse ?? await _breezSdkLiquid.instance?.getInfo();
walletInfo = walletInfo ?? (await _breezSdkLiquid.instance?.getInfo()).walletInfo;
if (getInfoResponse != null) {
await _registerWebhooks(getInfoResponse.walletInfo);
await _registerWebhooks(walletInfo);
} else {
throw Exception('Unable to retrieve wallet information.');
}
Expand Down

0 comments on commit ab0abfe

Please sign in to comment.