fix some type errors
This commit is contained in:
@@ -177,7 +177,14 @@ export function useNotificationsHandler() {
|
|||||||
|
|
||||||
Notifications.setNotificationHandler({
|
Notifications.setNotificationHandler({
|
||||||
handleNotification: async e => {
|
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(
|
logger.debug(
|
||||||
'Notifications: received',
|
'Notifications: received',
|
||||||
@@ -220,6 +227,9 @@ export function useNotificationsHandler() {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
e.actionIdentifier === Notifications.DEFAULT_ACTION_IDENTIFIER &&
|
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'
|
e.notification.request.trigger.type === 'push'
|
||||||
) {
|
) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ const getKey = (label: string, index: number, id?: string) => {
|
|||||||
return `${label}_${index}`
|
return `${label}_${index}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error - web only styles. the only style that should be broken here is `outline`
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
separator: {
|
separator: {
|
||||||
height: 1,
|
height: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user