Fix `notificationPreference` status (#2723)

This commit is contained in:
Howard Wu 2023-08-30 11:10:18 +08:00 committed by GitHub
parent 37b38d8f1d
commit bce03a864b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -173,8 +173,8 @@ public class SettingsFragment extends BaseFragment {
MaterialSwitchPreference notificationPreference = findPreference("enable_status_notification");
if (notificationPreference != null) {
notificationPreference.setVisible(installed);
if (installed && App.isParasitic) {
notificationPreference.setChecked(setNotificationPreferenceEnabled(notificationPreference, ShortcutUtil.isLaunchShortcutPinned()));
if (installed) {
notificationPreference.setChecked(setNotificationPreferenceEnabled(notificationPreference, !App.isParasitic || ShortcutUtil.isLaunchShortcutPinned()));
}
notificationPreference.setOnPreferenceChangeListener((p, v) -> {
var succeeded = ConfigManager.setEnableStatusNotification((boolean) v);