From c5fc54e7215a25d95af7c214d5118ed5553289f9 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Sun, 3 Sep 2023 21:48:28 +0700 Subject: [PATCH] fix(installer): open the patched app after install (#1233) --- lib/ui/views/installer/installer_view.dart | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 7e072b1f..7988d6fb 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -23,9 +23,21 @@ class InstallerView extends StatelessWidget { floatingActionButton: Visibility( visible: !model.isPatching && !model.hasErrors, child: FloatingActionButton.extended( - label: I18nText('installerView.installButton'), - icon: const Icon(Icons.file_download_outlined), - onPressed: () => model.installTypeDialog(context), + label: I18nText( + model.isInstalled + ? 'installerView.openButton' + : 'installerView.installButton', + ), + icon: model.isInstalled + ? const Icon(Icons.open_in_new) + : const Icon(Icons.file_download_outlined), + onPressed: model.isInstalled + ? () => { + model.openApp(), + model.cleanPatcher(), + Navigator.of(context).pop(), + } + : () => model.installTypeDialog(context), elevation: 0, ), ),