From e7d82850c92e33285082def4faf725d705379e7b Mon Sep 17 00:00:00 2001 From: aAbed <39409020+TheAabedKhan@users.noreply.github.com> Date: Wed, 8 Nov 2023 04:22:59 +0545 Subject: [PATCH] fix: Log saved patch option values (#1420) --- lib/ui/views/installer/installer_viewmodel.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index 73b23027ae..39a59db4f8 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -181,6 +181,14 @@ class InstallerViewModel extends BaseViewModel { Future copyLogs() async { final info = await AboutInfo.getInfo(); + dynamic getValue(String patchName, Option option) { + final Option? savedOption = _managerAPI.getPatchOption(_app.packageName, patchName, option.key); + if (savedOption != null) { + return savedOption.value; + } else { + return option.value; + } + } final formattedLogs = [ '- Device Info', @@ -194,7 +202,7 @@ class InstallerViewModel extends BaseViewModel { '\n- Patch Info', 'App: ${_app.packageName} v${_app.version}', 'Patches version: ${_managerAPI.patchesVersion}', - 'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${o.value}').join(", ")}]')).toList().join(", ")}', + 'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${getValue(p.name, o)}').join(", ")}]')).toList().join(", ")}', '\n- Settings', 'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}',