mirror of https://github.com/tooot-app/app
Bump versions
This commit is contained in:
parent
17b198c958
commit
7329c7038b
|
@ -8,7 +8,7 @@ ensure_env_vars(
|
||||||
VERSIONS = read_json( json_path: "./package.json" )[:versions]
|
VERSIONS = read_json( json_path: "./package.json" )[:versions]
|
||||||
ENVIRONMENT = ENV["ENVIRONMENT"]
|
ENVIRONMENT = ENV["ENVIRONMENT"]
|
||||||
VERSION = "#{VERSIONS[:major]}.#{VERSIONS[:minor]}"
|
VERSION = "#{VERSIONS[:major]}.#{VERSIONS[:minor]}"
|
||||||
RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{VERSIONS[:minor]}-#{ENVIRONMENT}"
|
RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{ENVIRONMENT}"
|
||||||
BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"]
|
BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"]
|
||||||
GITHUB_REPO = "tooot-app/app"
|
GITHUB_REPO = "tooot-app/app"
|
||||||
case ENVIRONMENT
|
case ENVIRONMENT
|
||||||
|
|
56
package.json
56
package.json
|
@ -23,21 +23,21 @@
|
||||||
"release": "scripts/release.sh"
|
"release": "scripts/release.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/react-native-action-sheet": "^3.8.0",
|
"@expo/react-native-action-sheet": "^3.9.0",
|
||||||
"@neverdull-agency/expo-unlimited-secure-store": "^1.0.10",
|
"@neverdull-agency/expo-unlimited-secure-store": "^1.0.10",
|
||||||
"@react-native-async-storage/async-storage": "^1.13.3",
|
"@react-native-async-storage/async-storage": "^1.14.1",
|
||||||
"@react-native-community/blur": "^3.6.0",
|
"@react-native-community/blur": "^3.6.0",
|
||||||
"@react-native-community/cameraroll": "^4.0.2",
|
"@react-native-community/cameraroll": "^4.0.2",
|
||||||
"@react-native-community/masked-view": "0.1.10",
|
"@react-native-community/masked-view": "0.1.10",
|
||||||
"@react-native-community/netinfo": "^5.9.10",
|
"@react-native-community/netinfo": "^6.0.0",
|
||||||
"@react-native-community/segmented-control": "2.2.2",
|
"@react-native-community/segmented-control": "2.2.2",
|
||||||
"@react-native-community/viewpager": "4.2.2",
|
"@react-native-community/viewpager": "4.2.2",
|
||||||
"@react-navigation/bottom-tabs": "^5.11.7",
|
"@react-navigation/bottom-tabs": "^5.11.8",
|
||||||
"@react-navigation/native": "^5.9.2",
|
"@react-navigation/native": "^5.9.3",
|
||||||
"@react-navigation/stack": "^5.14.2",
|
"@react-navigation/stack": "^5.14.3",
|
||||||
"@reduxjs/toolkit": "^1.5.0",
|
"@reduxjs/toolkit": "^1.5.0",
|
||||||
"@sentry/react-native": "^2.1.1",
|
"@sentry/react-native": "^2.1.1",
|
||||||
"@sharcoux/slider": "^5.0.4",
|
"@sharcoux/slider": "^5.1.3",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"expo": "^40.0.1",
|
"expo": "^40.0.1",
|
||||||
"expo-auth-session": "~3.0.0",
|
"expo-auth-session": "~3.0.0",
|
||||||
|
@ -57,41 +57,41 @@
|
||||||
"expo-store-review": "~2.3.0",
|
"expo-store-review": "~2.3.0",
|
||||||
"expo-video-thumbnails": "~4.4.0",
|
"expo-video-thumbnails": "~4.4.0",
|
||||||
"expo-web-browser": "~8.6.0",
|
"expo-web-browser": "~8.6.0",
|
||||||
"i18next": "^19.8.5",
|
"i18next": "^19.9.2",
|
||||||
"li": "^1.3.0",
|
"li": "^1.3.0",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.21",
|
||||||
"react": "16.13.1",
|
"react": "16.13.1",
|
||||||
"react-dom": "16.13.1",
|
"react-dom": "16.13.1",
|
||||||
"react-i18next": "^11.8.5",
|
"react-i18next": "^11.8.10",
|
||||||
"react-native": "~0.63.4",
|
"react-native": "~0.63.4",
|
||||||
"react-native-animated-spinkit": "^1.5.1",
|
"react-native-animated-spinkit": "^1.5.2",
|
||||||
"react-native-blurhash": "^1.0.29",
|
"react-native-blurhash": "^1.1.4",
|
||||||
"react-native-fast-image": "^8.3.4",
|
"react-native-fast-image": "^8.3.4",
|
||||||
"react-native-feather": "^1.0.2",
|
"react-native-feather": "^1.0.2",
|
||||||
"react-native-flash-message": "^0.1.23",
|
"react-native-flash-message": "^0.1.23",
|
||||||
"react-native-gesture-handler": "~1.9.0",
|
"react-native-gesture-handler": "~1.10.3",
|
||||||
"react-native-htmlview": "^0.16.0",
|
"react-native-htmlview": "^0.16.0",
|
||||||
"react-native-reanimated": "^2.0.0-rc.2",
|
"react-native-pager-view": "^5.1.2",
|
||||||
"react-native-safe-area-context": "3.1.9",
|
"react-native-reanimated": "^2.0.0",
|
||||||
|
"react-native-safe-area-context": "3.2.0",
|
||||||
"react-native-screens": "~2.18.1",
|
"react-native-screens": "~2.18.1",
|
||||||
"react-native-svg": "12.1.0",
|
"react-native-svg": "12.1.0",
|
||||||
"react-native-swipe-list-view": "^3.2.6",
|
"react-native-swipe-list-view": "^3.2.6",
|
||||||
"react-native-tab-view": "^2.15.2",
|
"react-native-tab-view": "^3.0.0",
|
||||||
"react-native-tab-view-viewpager-adapter": "^1.1.0",
|
|
||||||
"react-native-unimodules": "~0.12.0",
|
"react-native-unimodules": "~0.12.0",
|
||||||
"react-query": "^3.12.0",
|
"react-query": "^3.12.1",
|
||||||
"react-redux": "^7.2.2",
|
"react-redux": "^7.2.2",
|
||||||
"react-timeago": "^5.2.0",
|
"react-timeago": "^5.2.0",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"rn-placeholder": "^3.0.3",
|
"rn-placeholder": "^3.0.3",
|
||||||
"sentry-expo": "^3.0.4",
|
"sentry-expo": "^3.0.5",
|
||||||
"tslib": "^2.1.0"
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "~7.12.10",
|
"@babel/core": "~7.13.10",
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
|
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
|
||||||
"@babel/preset-typescript": "^7.12.7",
|
"@babel/preset-typescript": "^7.13.0",
|
||||||
"@expo/config": "^3.3.26",
|
"@expo/config": "^3.3.31",
|
||||||
"@jest/types": "^26.6.2",
|
"@jest/types": "^26.6.2",
|
||||||
"@testing-library/jest-native": "^3.4.3",
|
"@testing-library/jest-native": "^3.4.3",
|
||||||
"@testing-library/react-hooks": "^3.7.0",
|
"@testing-library/react-hooks": "^3.7.0",
|
||||||
|
@ -114,10 +114,10 @@
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"jest-expo": "^40.0.1",
|
"jest-expo": "^40.0.1",
|
||||||
"nock": "^13.0.5",
|
"nock": "^13.0.5",
|
||||||
"react-navigation": "^4.4.3",
|
"react-navigation": "^4.4.4",
|
||||||
"react-navigation-stack": "^2.10.2",
|
"react-navigation-stack": "^2.10.4",
|
||||||
"react-test-renderer": "^16.13.1",
|
"react-test-renderer": "^16.13.1",
|
||||||
"typescript": "~4.1.3",
|
"typescript": "~4.2.3",
|
||||||
"uri-scheme": "^1.0.67"
|
"uri-scheme": "^1.0.68"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,7 +5,6 @@ import audio from '@root/startup/audio'
|
||||||
import dev from '@root/startup/dev'
|
import dev from '@root/startup/dev'
|
||||||
import log from '@root/startup/log'
|
import log from '@root/startup/log'
|
||||||
import netInfo from '@root/startup/netInfo'
|
import netInfo from '@root/startup/netInfo'
|
||||||
import onlineStatus from '@root/startup/onlineStatus'
|
|
||||||
import sentry from '@root/startup/sentry'
|
import sentry from '@root/startup/sentry'
|
||||||
import { persistor, store } from '@root/store'
|
import { persistor, store } from '@root/store'
|
||||||
import { getSettingsLanguage } from '@utils/slices/settingsSlice'
|
import { getSettingsLanguage } from '@utils/slices/settingsSlice'
|
||||||
|
@ -28,7 +27,6 @@ dev()
|
||||||
sentry()
|
sentry()
|
||||||
audio()
|
audio()
|
||||||
push()
|
push()
|
||||||
onlineStatus()
|
|
||||||
|
|
||||||
log('log', 'react-query', 'initializing')
|
log('log', 'react-query', 'initializing')
|
||||||
const queryClient = new QueryClient()
|
const queryClient = new QueryClient()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { displayMessage, Message } from '@components/Message'
|
import { displayMessage, Message, removeMessage } from '@components/Message'
|
||||||
|
import { useNetInfo } from '@react-native-community/netinfo'
|
||||||
import {
|
import {
|
||||||
NavigationContainer,
|
NavigationContainer,
|
||||||
NavigationContainerRef
|
NavigationContainerRef
|
||||||
|
@ -22,7 +23,7 @@ import React, { createRef, useCallback, useEffect, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Alert, Platform, StatusBar } from 'react-native'
|
import { Alert, Platform, StatusBar } from 'react-native'
|
||||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
import { useQueryClient } from 'react-query'
|
import { onlineManager, useQueryClient } from 'react-query'
|
||||||
import { useDispatch, useSelector } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
import * as Sentry from 'sentry-expo'
|
import * as Sentry from 'sentry-expo'
|
||||||
|
|
||||||
|
@ -46,18 +47,25 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
||||||
|
|
||||||
const routeNameRef = useRef<string | undefined>()
|
const routeNameRef = useRef<string | undefined>()
|
||||||
|
|
||||||
// const isConnected = useNetInfo().isConnected
|
const isConnected = useNetInfo().isConnected
|
||||||
// const [firstRender, setFirstRender] = useState(false)
|
useEffect(() => {
|
||||||
// useEffect(() => {
|
switch (isConnected) {
|
||||||
// if (firstRender) {
|
case true:
|
||||||
// // bug in netInfo on first render as false
|
onlineManager.setOnline(isConnected)
|
||||||
// if (isConnected !== false) {
|
removeMessage()
|
||||||
// toast({ type: 'error', content: '手机🈚️网络', autoHide: false })
|
break
|
||||||
// }
|
case false:
|
||||||
// } else {
|
onlineManager.setOnline(isConnected)
|
||||||
// setFirstRender(true)
|
displayMessage({
|
||||||
// }
|
mode,
|
||||||
// }, [isConnected, firstRender])
|
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(
|
||||||
|
@ -192,3 +200,6 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default React.memo(Screens, () => true)
|
export default React.memo(Screens, () => true)
|
||||||
|
function toast (arg0: { type: string; content: string; autoHide: boolean }) {
|
||||||
|
throw new Error('Function not implemented.')
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ const apiInstance = async <T = unknown>({
|
||||||
domain = state.instances.instances[instanceActive].url
|
domain = state.instances.instances[instanceActive].url
|
||||||
token = state.instances.instances[instanceActive].token
|
token = state.instances.instances[instanceActive].token
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.warn(
|
||||||
ctx.bgRed.white.bold(' API ') + ' ' + 'No instance domain is provided'
|
ctx.bgRed.white.bold(' API ') + ' ' + 'No instance domain is provided'
|
||||||
)
|
)
|
||||||
return Promise.reject()
|
return Promise.reject()
|
||||||
|
|
|
@ -3,7 +3,10 @@ import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import { getTheme } from '@utils/styles/themes'
|
import { getTheme } from '@utils/styles/themes'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import FlashMessage, { showMessage } from 'react-native-flash-message'
|
import FlashMessage, {
|
||||||
|
hideMessage,
|
||||||
|
showMessage
|
||||||
|
} from 'react-native-flash-message'
|
||||||
import haptics from './haptics'
|
import haptics from './haptics'
|
||||||
|
|
||||||
const displayMessage = ({
|
const displayMessage = ({
|
||||||
|
@ -70,6 +73,10 @@ const displayMessage = ({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const removeMessage = () => {
|
||||||
|
hideMessage()
|
||||||
|
}
|
||||||
|
|
||||||
const Message = React.memo(
|
const Message = React.memo(
|
||||||
() => {
|
() => {
|
||||||
const { mode, theme } = useTheme()
|
const { mode, theme } = useTheme()
|
||||||
|
@ -100,4 +107,4 @@ const Message = React.memo(
|
||||||
() => true
|
() => true
|
||||||
)
|
)
|
||||||
|
|
||||||
export { Message, displayMessage }
|
export { Message, displayMessage, removeMessage }
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
export default {
|
export default {
|
||||||
|
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!",
|
||||||
button: 'Confirm'
|
button: 'Confirm'
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
export default {
|
export default {
|
||||||
|
network: {
|
||||||
|
disconnected: {
|
||||||
|
message: '无法连接到网络',
|
||||||
|
description: '请检查手机设置里的网络连接'
|
||||||
|
}
|
||||||
|
},
|
||||||
screenshot: {
|
screenshot: {
|
||||||
title: '隐私保护',
|
title: '隐私保护',
|
||||||
message: '请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!',
|
message: '请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!',
|
||||||
|
|
|
@ -5,12 +5,10 @@ import TimelineDefault from '@components/Timeline/Default'
|
||||||
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
||||||
import { ScreenTabsParamList } from '@screens/Tabs'
|
import { ScreenTabsParamList } from '@screens/Tabs'
|
||||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
|
||||||
import React, { useCallback, useMemo } from 'react'
|
import React, { useCallback, useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Platform } from 'react-native'
|
import { Platform } from 'react-native'
|
||||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
import { useSelector } from 'react-redux'
|
|
||||||
import sharedScreens from './Shared/sharedScreens'
|
import sharedScreens from './Shared/sharedScreens'
|
||||||
|
|
||||||
export type TabLocalProp = BottomTabScreenProps<
|
export type TabLocalProp = BottomTabScreenProps<
|
||||||
|
@ -23,7 +21,6 @@ const Stack = createNativeStackNavigator<Nav.TabLocalStackParamList>()
|
||||||
const TabLocal = React.memo(
|
const TabLocal = React.memo(
|
||||||
({ navigation }: TabLocalProp) => {
|
({ navigation }: TabLocalProp) => {
|
||||||
const { t } = useTranslation('local')
|
const { t } = useTranslation('local')
|
||||||
const instanceActive = useSelector(getInstanceActive)
|
|
||||||
|
|
||||||
const screenOptions = useMemo(
|
const screenOptions = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
@ -60,10 +57,7 @@ const TabLocal = React.memo(
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
const children = useCallback(
|
const children = useCallback(
|
||||||
() =>
|
() => <Timeline queryKey={queryKey} customProps={{ renderItem }} />,
|
||||||
instanceActive !== -1 ? (
|
|
||||||
<Timeline queryKey={queryKey} customProps={{ renderItem }} />
|
|
||||||
) : null,
|
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,19 +4,15 @@ import Timeline from '@components/Timeline'
|
||||||
import TimelineDefault from '@components/Timeline/Default'
|
import TimelineDefault from '@components/Timeline/Default'
|
||||||
import SegmentedControl from '@react-native-community/segmented-control'
|
import SegmentedControl from '@react-native-community/segmented-control'
|
||||||
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
|
||||||
import { ScreenTabsParamList } from '@screens/Tabs'
|
import { ScreenTabsParamList } from '@screens/Tabs'
|
||||||
import sharedScreens from '@screens/Tabs/Shared/sharedScreens'
|
import sharedScreens from '@screens/Tabs/Shared/sharedScreens'
|
||||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useCallback, useMemo, useState } from 'react'
|
import React, { useCallback, useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Dimensions, StyleSheet } from 'react-native'
|
import { Dimensions, StyleSheet } from 'react-native'
|
||||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
import { TabView } from 'react-native-tab-view'
|
import { TabView } from 'react-native-tab-view'
|
||||||
import ViewPagerAdapter from 'react-native-tab-view-viewpager-adapter'
|
|
||||||
import { useSelector } from 'react-redux'
|
|
||||||
|
|
||||||
export type TabPublicProps = BottomTabScreenProps<
|
export type TabPublicProps = BottomTabScreenProps<
|
||||||
ScreenTabsParamList,
|
ScreenTabsParamList,
|
||||||
|
@ -29,7 +25,6 @@ const TabPublic = React.memo(
|
||||||
({ navigation }: TabPublicProps) => {
|
({ navigation }: TabPublicProps) => {
|
||||||
const { t, i18n } = useTranslation()
|
const { t, i18n } = useTranslation()
|
||||||
const { mode } = useTheme()
|
const { mode } = useTheme()
|
||||||
const instanceActive = useSelector(getInstanceActive)
|
|
||||||
|
|
||||||
const [segment, setSegment] = useState(0)
|
const [segment, setSegment] = useState(0)
|
||||||
const pages: {
|
const pages: {
|
||||||
|
@ -82,10 +77,7 @@ const TabPublic = React.memo(
|
||||||
)
|
)
|
||||||
|
|
||||||
const routes = pages.map(p => ({ key: p.key }))
|
const routes = pages.map(p => ({ key: p.key }))
|
||||||
const renderPager = useCallback(
|
|
||||||
props => <ViewPagerAdapter {...props} />,
|
|
||||||
[]
|
|
||||||
)
|
|
||||||
const renderScene = useCallback(
|
const renderScene = useCallback(
|
||||||
({
|
({
|
||||||
route: { key: page }
|
route: { key: page }
|
||||||
|
@ -103,20 +95,19 @@ const TabPublic = React.memo(
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
const children = useCallback(
|
const children = useCallback(
|
||||||
() =>
|
() => (
|
||||||
instanceActive !== -1 ? (
|
// @ts-ignore
|
||||||
<TabView
|
<TabView
|
||||||
lazy
|
lazy
|
||||||
swipeEnabled
|
swipeEnabled
|
||||||
renderPager={renderPager}
|
renderScene={renderScene}
|
||||||
renderScene={renderScene}
|
renderTabBar={() => null}
|
||||||
renderTabBar={() => null}
|
onIndexChange={index => setSegment(index)}
|
||||||
onIndexChange={index => setSegment(index)}
|
navigationState={{ index: segment, routes }}
|
||||||
navigationState={{ index: segment, routes }}
|
initialLayout={{ width: Dimensions.get('screen').width }}
|
||||||
initialLayout={{ width: Dimensions.get('screen').width }}
|
/>
|
||||||
/>
|
),
|
||||||
) : null,
|
[segment]
|
||||||
[segment, instanceActive]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -13,6 +13,7 @@ const netInfo = async (): Promise<{
|
||||||
corrupted?: string
|
corrupted?: string
|
||||||
}> => {
|
}> => {
|
||||||
log('log', 'netInfo', 'initializing')
|
log('log', 'netInfo', 'initializing')
|
||||||
|
|
||||||
const netInfo = await NetInfo.fetch()
|
const netInfo = await NetInfo.fetch()
|
||||||
const instance = getInstance(store.getState())
|
const instance = getInstance(store.getState())
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
import NetInfo from '@react-native-community/netinfo'
|
|
||||||
import { onlineManager } from 'react-query'
|
|
||||||
import log from './log'
|
|
||||||
|
|
||||||
const onlineStatus = () =>
|
|
||||||
onlineManager.setEventListener(setOnline => {
|
|
||||||
log('log', 'onlineStatus', 'added onlineManager listener')
|
|
||||||
return NetInfo.addEventListener(state => {
|
|
||||||
log('log', 'onlineStatus', `setting online state ${state.isConnected}`)
|
|
||||||
// @ts-ignore
|
|
||||||
setOnline(state.isConnected)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
export default onlineStatus
|
|
Loading…
Reference in New Issue