Prevent unselecting machine reminder value

This commit is contained in:
keplyx 2020-03-08 13:57:09 +01:00
parent a9fcbfe719
commit 97d84d92f5

View file

@ -45,15 +45,17 @@ export default class SettingsScreen extends React.Component<Props, State> {
* @param value The value to store
*/
onProxiwashNotifPickerValueChange(value: string) {
let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key;
AsyncStorageManager.getInstance().savePref(key, value);
this.setState({
proxiwashNotifPickerSelected: value
});
let intVal = 0;
if (value !== 'never')
intVal = parseInt(value);
NotificationsManager.setMachineReminderNotificationTime(intVal);
if (value != null) {
let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key;
AsyncStorageManager.getInstance().savePref(key, value);
this.setState({
proxiwashNotifPickerSelected: value
});
let intVal = 0;
if (value !== 'never')
intVal = parseInt(value);
NotificationsManager.setMachineReminderNotificationTime(intVal);
}
}
/**