Skip to content

Commit

Permalink
support branch link
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Nov 6, 2023
1 parent d94b115 commit 670e525
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/service/deeplink_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,20 @@ class DeeplinkServiceImpl extends DeeplinkService {
link: link,
linkType: LinkType.postcardPayToMint,
prefix: callingPostcardPayToMintPrefix);
await _handlePayToMint(link);
await _handlePayToMintDeepLink(link);
return true;
}
memoryValues.deepLink.value = null;
return false;
}

Future<void> _handlePayToMint(String link) async {
Future<void> _handlePayToMintDeepLink(String link) async {
log.info("[DeeplinkService] _handlePayToMint");
_deepLinkHandlingMap.remove(link);
await _handlePayToMint();
}

Future<void> _handlePayToMint() async {
final address = await _navigationService.navigateTo(
AppRouter.selectAddressScreen,
arguments: {
Expand All @@ -305,7 +309,8 @@ class DeeplinkServiceImpl extends DeeplinkService {
},
);
if (address == null) return;
final url = "${Environment.payToMintBaseUrl}/moma-postcard?address=$address";
final url =
"${Environment.payToMintBaseUrl}/moma-postcard?address=$address";
final response = (await _navigationService.goToIRLWebview(
IRLWebScreenPayload(url,
isPlainUI: true, statusBarColor: POSTCARD_BACKGROUND_COLOR)))
Expand Down Expand Up @@ -451,6 +456,10 @@ class DeeplinkServiceImpl extends DeeplinkService {
memoryValues.irlLink.value = null;
}
break;

case "moma_postcard_purchase":
await _handlePayToMint();
break;
case "autonomy_airdrop":
final String? sharedCode = data["share_code"];
if (sharedCode != null) {
Expand Down

0 comments on commit 670e525

Please sign in to comment.