mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-04 16:06:41 +00:00
fix: say why an event couldn't be saved instead of failing silently
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
StyleSheet,
|
StyleSheet,
|
||||||
Switch,
|
Switch,
|
||||||
Platform,
|
Platform,
|
||||||
|
Alert as NativeAlert,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||||
import DateTimePicker from '@react-native-community/datetimepicker';
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
||||||
@@ -364,6 +365,12 @@ export function EventModal({
|
|||||||
sendSchedulingMessages: attendees.length > 0 && sendInvitations,
|
sendSchedulingMessages: attendees.length > 0 && sendInvitations,
|
||||||
});
|
});
|
||||||
onClose();
|
onClose();
|
||||||
|
} catch (err) {
|
||||||
|
// The editor stays open with everything typed, and says why.
|
||||||
|
NativeAlert.alert(
|
||||||
|
t('calendar.notifications.event_error', 'Failed to save event'),
|
||||||
|
err instanceof Error ? err.message : undefined,
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
setSaving(false);
|
setSaving(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user