mirror of https://github.com/tooot-app/app
Remove network warning
This commit is contained in:
parent
5ddc370588
commit
79dbba7f08
|
@ -1,7 +1,6 @@
|
||||||
import { HeaderLeft } from '@components/Header'
|
import { HeaderLeft } from '@components/Header'
|
||||||
import { displayMessage, Message, removeMessage } from '@components/Message'
|
import { displayMessage, Message } from '@components/Message'
|
||||||
import navigationRef from '@helpers/navigationRef'
|
import navigationRef from '@helpers/navigationRef'
|
||||||
import { useNetInfo } from '@react-native-community/netinfo'
|
|
||||||
import { NavigationContainer } from '@react-navigation/native'
|
import { NavigationContainer } from '@react-navigation/native'
|
||||||
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
||||||
import ScreenActions from '@screens/Actions'
|
import ScreenActions from '@screens/Actions'
|
||||||
|
@ -49,24 +48,6 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
||||||
|
|
||||||
const routeRef = useRef<{ name?: string; params?: {} }>()
|
const routeRef = useRef<{ name?: string; params?: {} }>()
|
||||||
|
|
||||||
const isConnected = useNetInfo().isConnected
|
|
||||||
useEffect(() => {
|
|
||||||
switch (isConnected) {
|
|
||||||
case true:
|
|
||||||
removeMessage()
|
|
||||||
break
|
|
||||||
case false:
|
|
||||||
displayMessage({
|
|
||||||
mode,
|
|
||||||
type: 'error',
|
|
||||||
message: t('network.disconnected.message'),
|
|
||||||
description: t('network.disconnected.description'),
|
|
||||||
autoHide: false
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}, [isConnected])
|
|
||||||
|
|
||||||
// Push hooks
|
// Push hooks
|
||||||
const instances = useSelector(
|
const instances = useSelector(
|
||||||
getInstances,
|
getInstances,
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{
|
||||||
"network": {
|
|
||||||
"disconnected": {
|
|
||||||
"message": "Lost network connection",
|
|
||||||
"description": "Please check your phone's network setting"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"screenshot": {
|
"screenshot": {
|
||||||
"title": "Privacy Protection",
|
"title": "Privacy Protection",
|
||||||
"message": "Please do not disclose other user's identity, such as username, avatar, etc. Thank you!",
|
"message": "Please do not disclose other user's identity, such as username, avatar, etc. Thank you!",
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{
|
||||||
"network": {
|
|
||||||
"disconnected": {
|
|
||||||
"message": "无法连接到网络",
|
|
||||||
"description": "请检查手机设置里的网络连接"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"screenshot": {
|
"screenshot": {
|
||||||
"title": "隐私保护",
|
"title": "隐私保护",
|
||||||
"message": "请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!",
|
"message": "请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!",
|
||||||
|
|
Loading…
Reference in New Issue