Skip to content

Commit 682ee29

Browse files
committed
fix(notifications): register again when changing the refresh interval
1 parent d2f7e72 commit 682ee29

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/Screens/Settings/notifications.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class _NotificationsSettingsScreenState
106106
if (value) {
107107
await Notifications().registerPeriodicTask();
108108
} else {
109-
Workmanager().cancelAll();
109+
await Workmanager().cancelAll();
110110
}
111111
setState(
112112
() {
@@ -163,14 +163,13 @@ class _NotificationsSettingsScreenState
163163
trailing: DropdownButton(
164164
value: refreshInterval,
165165
onChanged: notificationsEnabled && newsNotificationsEnabled
166-
? (int? newValue) {
166+
? (int? newValue) async {
167167
if (newValue != null) {
168+
refreshInterval = newValue;
169+
Hive.box('settings').put('refreshInterval', newValue);
170+
await Notifications().registerPeriodicTask();
168171
setState(
169-
() {
170-
refreshInterval = newValue;
171-
Hive.box('settings')
172-
.put('refreshInterval', newValue);
173-
},
172+
() {},
174173
);
175174
}
176175
}

0 commit comments

Comments
 (0)