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 * @param value The value to store
*/ */
onProxiwashNotifPickerValueChange(value: string) { onProxiwashNotifPickerValueChange(value: string) {
let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key; if (value != null) {
AsyncStorageManager.getInstance().savePref(key, value); let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key;
this.setState({ AsyncStorageManager.getInstance().savePref(key, value);
proxiwashNotifPickerSelected: value this.setState({
}); proxiwashNotifPickerSelected: value
let intVal = 0; });
if (value !== 'never') let intVal = 0;
intVal = parseInt(value); if (value !== 'never')
NotificationsManager.setMachineReminderNotificationTime(intVal); intVal = parseInt(value);
NotificationsManager.setMachineReminderNotificationTime(intVal);
}
} }
/** /**