Skip to content

Commit 92189ee

Browse files
Init notifications only if isDevice and update dependencies
1 parent b6ac876 commit 92189ee

3 files changed

Lines changed: 884 additions & 558 deletions

File tree

mobile/contexts/notification/NotificationContextProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { registerForPushNotificationsAsync } from "../../common/utils/notificati
33
import * as Notifications from "expo-notifications";
44
// import { registerPushToken, unregisterPushToken } from '../../services/settings/settings.api';
55
import { NotificationContext } from "./NotificationContext";
6+
import * as Device from "expo-device";
67

78
import { useAuth } from "../../hooks/useAuth";
89
import {
@@ -53,7 +54,7 @@ const NotificationContextProvider = ({ children }: { children: React.ReactNode }
5354
const init = useCallback(initNotifications, [initNotifications]);
5455

5556
useEffect(() => {
56-
if (isAuthenticated) {
57+
if (isAuthenticated && Device.isDevice) {
5758
init();
5859
}
5960
}, [isAuthenticated]);

0 commit comments

Comments
 (0)