Skip to content

Commit 30c9c23

Browse files
authored
Merge pull request #84 from funnyzak/bug/openbrower
2 parents 4571405 + 7f5bf14 commit 30c9c23

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/screens/common/WebLink.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import React, { useEffect, useLayoutEffect, useMemo, useRef } from 'react'
2-
import { View } from 'react-native'
3-
import { WebView, WebViewProps } from 'react-native-webview'
2+
import { WebView } from 'react-native-webview'
43

5-
import { useTheme, SylCommon } from '@src/theme'
6-
import { WebViewerScreenProps as ScreenProps } from '@src/navigation/routes'
74
import { Spinner } from '@src/components'
8-
import { HeaderButton } from '../components'
9-
import { linking } from '@src/utils'
105
import { translate } from '@src/i18n'
6+
import { WebViewerScreenProps as ScreenProps } from '@src/navigation/routes'
7+
import { SylCommon, useTheme } from '@src/theme'
8+
import { linking } from '@src/utils'
9+
import { HeaderButton } from '../components'
1110

1211
const WebLink = ({ route, navigation }: ScreenProps) => {
1312
const { theme } = useTheme()
14-
const webViewRef = useRef(new WebView<{ current?: any }>({}))
13+
const webViewRef = useRef<WebView>(null)
1514
const [loading, setLoading] = React.useState(true)
1615
const url = useMemo(
1716
() => (!route.params.url.startsWith('http') ? `http://${route.params.url}` : route.params.url),
@@ -33,7 +32,7 @@ const WebLink = ({ route, navigation }: ScreenProps) => {
3332
source={theme.assets.images.icons.header.refresh}
3433
onPress={() => {
3534
setLoading(true)
36-
webViewRef.current.reload()
35+
webViewRef.current?.reload()
3736
}}
3837
/>
3938
<HeaderButton

0 commit comments

Comments
 (0)