This commit is contained in:
Marcos Rodriguez Velez 2024-10-04 00:53:42 -04:00
commit 63a98b87cb

View file

@ -41,6 +41,7 @@ const NotificationSettings: React.FC = () => {
};
const onNotificationsSwitch = async (value: boolean) => {
try {
setNotificationsEnabled(value);
if (value) {
// User is enabling notifications
@ -64,6 +65,10 @@ const NotificationSettings: React.FC = () => {
// @ts-ignore: refactor later
setNotificationsEnabled(await Notifications.isNotificationsEnabled());
} catch (error) {
console.error(error);
presentAlert({ message: error.message });
}
};
useEffect(() => {