From 4acd7383530059af744f442127caf30672dbbf94 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 7 Mar 2024 23:42:41 +0100 Subject: [PATCH] fix: Fix white-screen when trying to install conflicting apps When you tried to install a patched app, but it conflicted with an existing installation, the screen would go blank. This was caused by trying to use an argument on a translation with no arguments. --- lib/services/patcher_api.dart | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/services/patcher_api.dart b/lib/services/patcher_api.dart index 7d45a8bb..c65cd630 100644 --- a/lib/services/patcher_api.dart +++ b/lib/services/patcher_api.dart @@ -297,6 +297,18 @@ class PatcherAPI { ); bool cleanInstall = false; final bool isFixable = statusCode == 4 || statusCode == 5; + + var description = t['installErrorDialog.${statusValue}_description']; + if (statusCode == 2) { + description = description( + packageName: statusCode == 2 + ? { + 'packageName': status['otherPackageName'], + } + : null, + ); + } + await showDialog( context: _managerAPI.ctx!, builder: (context) => AlertDialog( @@ -306,15 +318,7 @@ class PatcherAPI { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Text( - t['installErrorDialog.${statusValue}_description']( - packageName: statusCode == 2 - ? { - 'packageName': status['otherPackageName'], - } - : null, - ), - ), + Text(description), ], ), actions: (status == null)