diff --git a/lib/pages/monkey/monkey_view.dart b/lib/pages/monkey/monkey_view.dart index af2fd91fd..2ad4b18eb 100644 --- a/lib/pages/monkey/monkey_view.dart +++ b/lib/pages/monkey/monkey_view.dart @@ -42,6 +42,7 @@ class MonkeyView extends ConsumerStatefulWidget { class _MonkeyViewState extends ConsumerState { late final String walletId; + List? imageBytes; String receivingAddress = ""; @@ -205,8 +206,7 @@ class _MonkeyViewState extends ConsumerState { final bool isDesktop = Util.isDesktop; - List? imageBytes; - imageBytes = (manager.wallet as BananoWallet).getMonkeyImageBytes(); + imageBytes ??= (manager.wallet as BananoWallet).getMonkeyImageBytes(); //edit for desktop return Background( @@ -360,7 +360,7 @@ class _MonkeyViewState extends ConsumerState { SizedBox( width: 300, height: 300, - child: SvgPicture.memory(Uint8List.fromList(imageBytes)), + child: SvgPicture.memory(Uint8List.fromList(imageBytes!)), ), isDesktop ? const SizedBox( @@ -466,6 +466,13 @@ class _MonkeyViewState extends ConsumerState { subMessage: "We are fetching your MonKey", ); + imageBytes = (manager.wallet as BananoWallet) + .getMonkeyImageBytes(); + + if (imageBytes != null) { + setState(() {}); + } + // if (isDesktop) { // Navigator.of(context).popUntil( // ModalRoute.withName(