Skip to content

Commit

Permalink
Revert "Force reload of chatroom webview everytime it refocuses"
Browse files Browse the repository at this point in the history
This reverts commit ed96259.
  • Loading branch information
lorenjohnson committed Jun 18, 2024
1 parent 2093613 commit 0e0e13a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/components/HyloWebView/HyloWebView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, forwardRef, useState } from 'react'
import React, { useCallback, forwardRef, useState, useEffect } from 'react'
import { useFocusEffect } from '@react-navigation/native'
import Loading from 'components/Loading'
import getRouteParam from 'store/selectors/getRouteParam'
Expand All @@ -23,15 +23,10 @@ const HyloWebView = forwardRef(function HyloWebView ({
const [uri, setUri] = useState()
const postId = getRouteParam('postId', route)

useFocusEffect(
useCallback(() => {
const path = pathProp || route?.params?.path
setUri((source?.uri || `${process.env.HYLO_WEB_BASE_URL}${path || ''}`) + (postId ? `?postId=${postId}` : ''))
return () => {
setUri(undefined)
}
}, [source?.uri, pathProp, route?.params?.path])
)
useEffect(() => {
const path = pathProp || route?.params?.path
setUri((source?.uri || `${process.env.HYLO_WEB_BASE_URL}${path || ''}`) + (postId ? `?postId=${postId}` : ''))
}, [source?.uri, pathProp, route?.params?.path])

useFocusEffect(
useCallback(() => {
Expand Down

0 comments on commit 0e0e13a

Please sign in to comment.