Skip to content

Commit

Permalink
fix: still having request when gracePeriod is over
Browse files Browse the repository at this point in the history
  • Loading branch information
jessgusclark committed Mar 29, 2024
1 parent a62861d commit 2e309a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Core = () => {
const topColor = useAppSelector(selectTopColor)
const setGlobalError = useSetGlobalError()
const isOffline = useIsOffline()
const { active } = useStateSubscription()
const { active, unlocked } = useStateSubscription()
const { wallet, initializeWallet } = useContext(WalletContext)

const unlockAppFn = useCallback(async () => {
Expand All @@ -62,7 +62,7 @@ export const Core = () => {
<WalletConnect2Provider wallet={wallet}>
<>
<RootNavigationComponent />
{requests.length !== 0 && wallet && (
{requests.length !== 0 && wallet && unlocked && (
<RequestHandler
wallet={wallet}
request={requests[0]}
Expand Down
5 changes: 5 additions & 0 deletions src/core/hooks/useStateSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
setPreviouslyUnlocked,
setUnlocked as setIsUnlocked,
unlockApp,
closeRequest,
setFullscreen,
} from 'store/slices/settingsSlice'
import { useAppDispatch, useAppSelector } from 'store/storeUtils'
import { SocketsEvents, socketsEvents } from 'src/subscriptions/rifSockets'
Expand Down Expand Up @@ -52,6 +54,9 @@ export const useStateSubscription = () => {

setUnlocked(false)
dispatch(setPreviouslyUnlocked(true))
// request needs to be reset when gracePeriod is over
dispatch(closeRequest())
dispatch(setFullscreen(false))
//reset wallet state
setWallet(null)
setWalletIsDeployed(null)
Expand Down

0 comments on commit 2e309a7

Please sign in to comment.