fix: Log saved patch option values (#1420)

This commit is contained in:
aAbed 2023-11-08 04:22:59 +05:45 committed by GitHub
parent e6a8f4e6dc
commit e7d82850c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,6 +181,14 @@ class InstallerViewModel extends BaseViewModel {
Future<void> 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()}',