From e11a786f7cccaf1d99312cc00fc52e16ec177aac Mon Sep 17 00:00:00 2001 From: phuoc Date: Fri, 23 Feb 2024 16:50:04 +0700 Subject: [PATCH 1/2] fix: pass owner to yoko ono irl Signed-off-by: phuoc --- lib/screen/detail/artwork_detail_page.dart | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/screen/detail/artwork_detail_page.dart b/lib/screen/detail/artwork_detail_page.dart index 52364e2c1..0ba2bddf4 100644 --- a/lib/screen/detail/artwork_detail_page.dart +++ b/lib/screen/detail/artwork_detail_page.dart @@ -171,7 +171,7 @@ class _ArtworkDetailPageState extends State Future _shareMemento(BuildContext context, AssetToken asset) async { final deeplink = await _airdropService.shareAirdrop(asset); if (deeplink == null) { - if (!mounted) { + if (!context.mounted) { return; } context @@ -187,7 +187,7 @@ class _ArtworkDetailPageState extends State await Share.share(shareMessage); } catch (e) { if (e is DioException) { - if (mounted) { + if (context.mounted) { unawaited(UIHelper.showSharePostcardFailed(context, e)); } } @@ -433,7 +433,7 @@ class _ArtworkDetailPageState extends State final addressIndex = owner?.second; final irlUrl = asset.irlTapLink; - if (!mounted) { + if (!context.mounted) { return; } final isHidden = _isHidden(asset); @@ -449,7 +449,8 @@ class _ArtworkDetailPageState extends State Navigator.pushNamed( context, AppRouter.irlWebView, - arguments: IRLWebScreenPayload(irlUrl.second), + arguments: IRLWebScreenPayload( + '${irlUrl.second}?owner=${asset.owner}'), ), ); }, @@ -489,7 +490,7 @@ class _ArtworkDetailPageState extends State downloadProgress.value = received / total; }); }); - if (!mounted) { + if (!context.mounted) { return; } setState(() { @@ -502,7 +503,7 @@ class _ArtworkDetailPageState extends State unawaited(UIHelper.showFeralfileArtworkSavedFailed(context)); } } catch (e) { - if (!mounted) { + if (!context.mounted) { return; } setState(() { @@ -523,7 +524,7 @@ class _ArtworkDetailPageState extends State .updateTempStorageHiddenTokenIDs([asset.id], !isHidden); unawaited(injector().backup()); - if (!mounted) { + if (!context.mounted) { return; } NftCollectionBloc.eventController.add(ReloadEvent()); @@ -564,7 +565,7 @@ class _ArtworkDetailPageState extends State .updateTempStorageHiddenTokenIDs([asset.id], false); unawaited(injector().backup()); } - if (!mounted) { + if (!context.mounted) { return; } setState(() {}); @@ -575,10 +576,6 @@ class _ArtworkDetailPageState extends State } return; } - - if (!mounted) { - return; - } unawaited(UIHelper.showMessageAction( context, 'success'.tr(), From 65ec1993e39fd0d3be84a5e97903d7346980ac3b Mon Sep 17 00:00:00 2001 From: phuoc Date: Fri, 23 Feb 2024 16:53:49 +0700 Subject: [PATCH 2/2] fix: pass in extension Signed-off-by: phuoc --- lib/screen/detail/artwork_detail_page.dart | 3 +-- lib/util/asset_token_ext.dart | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/screen/detail/artwork_detail_page.dart b/lib/screen/detail/artwork_detail_page.dart index 0ba2bddf4..0755a6513 100644 --- a/lib/screen/detail/artwork_detail_page.dart +++ b/lib/screen/detail/artwork_detail_page.dart @@ -449,8 +449,7 @@ class _ArtworkDetailPageState extends State Navigator.pushNamed( context, AppRouter.irlWebView, - arguments: IRLWebScreenPayload( - '${irlUrl.second}?owner=${asset.owner}'), + arguments: IRLWebScreenPayload(irlUrl.second), ), ); }, diff --git a/lib/util/asset_token_ext.dart b/lib/util/asset_token_ext.dart index 661d629f0..5a814aac2 100644 --- a/lib/util/asset_token_ext.dart +++ b/lib/util/asset_token_ext.dart @@ -395,7 +395,7 @@ extension AssetTokenExtension on AssetToken { return Pair( 'tape_sound'.tr(), '${Environment.feralFileAPIURL}/' - 'artwork/yoko-ono-sound-piece/$index/record', + 'artwork/yoko-ono-sound-piece/$index/record?owner=$owner', ); } }