Skip to content

Commit

Permalink
Fix refactoring bug
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Sep 5, 2023
1 parent 00bac99 commit 9c19315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/components/PushNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAgent } from '@aries-framework/react-hooks'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

import { registered, isMediatorCapable, userDenied } from '../helpers/PushNotificationsHelper'
import { isMediatorCapable, registered, setup, userDenied } from '../helpers/PushNotificationsHelper'
import PushNotificationsModal from '../modals/PushNotificationsModal'

const PushNotifications = () => {
Expand All @@ -13,16 +13,16 @@ const PushNotifications = () => {
const setupPushNotifications = async () => {
setInfoModalVisible(false)
if (!agent || (await userDenied())) return
setupPushNotifications()
setup(agent)
}

const setupFirebaseCapability = async () => {
const initializeCapabilityRequest = async () => {
if (!agent || !(await isMediatorCapable(agent)) || (await registered())) return
setInfoModalVisible(true)
}

useEffect(() => {
setupFirebaseCapability()
initializeCapabilityRequest()
}, [agent]) // Reload if agent becomes defined

return (
Expand Down

0 comments on commit 9c19315

Please sign in to comment.