fix some type errors

This commit is contained in:
Hailey
2024-12-01 17:22:28 -08:00
parent 273f2948e9
commit 04ccdd8540
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -177,7 +177,14 @@ export function useNotificationsHandler() {
Notifications.setNotificationHandler({
handleNotification: async e => {
if (e.request.trigger.type !== 'push') return DEFAULT_HANDLER_OPTIONS
if (
e.request.trigger == null ||
typeof e.request.trigger !== 'object' ||
!('type' in e.request.trigger) ||
e.request.trigger.type !== 'push'
) {
return DEFAULT_HANDLER_OPTIONS
}
logger.debug(
'Notifications: received',
@@ -220,6 +227,9 @@ export function useNotificationsHandler() {
if (
e.actionIdentifier === Notifications.DEFAULT_ACTION_IDENTIFIER &&
e.notification.request.trigger != null &&
typeof e.notification.request.trigger === 'object' &&
'type' in e.notification.request.trigger &&
e.notification.request.trigger.type === 'push'
) {
logger.debug(
@@ -229,6 +229,7 @@ const getKey = (label: string, index: number, id?: string) => {
return `${label}_${index}`
}
// @ts-expect-error - web only styles. the only style that should be broken here is `outline`
const styles = StyleSheet.create({
separator: {
height: 1,