From 811dda9b17234bcdbd55f48be57b03ee9838cc19 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 26 Oct 2023 09:38:02 +0200 Subject: [PATCH] Fixed adjusting poll interval --- app/src/main/java/eu/faircode/email/FragmentSetup.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index db55755265..d7cba814eb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -666,7 +666,10 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS cbAlways.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton v, boolean isChecked) { - int value = (isChecked ? 0 : EntityAccount.DEFAULT_POLL_INTERVAL); + int poll_interval = prefs.getInt("poll_interval", EntityAccount.DEFAULT_POLL_INTERVAL); + if (poll_interval == 0) + poll_interval = EntityAccount.DEFAULT_POLL_INTERVAL; + int value = (isChecked ? 0 : poll_interval); prefs.edit().putInt("poll_interval", value).apply(); if (value == 0) prefs.edit().remove("auto_optimize").apply();