Bump versions

This commit is contained in:
Zhiyuan Zheng 2021-03-15 22:30:29 +01:00
parent 17b198c958
commit 7329c7038b
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
13 changed files with 1057 additions and 211 deletions

View File

@ -8,7 +8,7 @@ ensure_env_vars(
VERSIONS = read_json( json_path: "./package.json" )[:versions]
ENVIRONMENT = ENV["ENVIRONMENT"]
VERSION = "#{VERSIONS[:major]}.#{VERSIONS[:minor]}"
RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{VERSIONS[:minor]}-#{ENVIRONMENT}"
RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{ENVIRONMENT}"
BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"]
GITHUB_REPO = "tooot-app/app"
case ENVIRONMENT

View File

@ -23,21 +23,21 @@
"release": "scripts/release.sh"
},
"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",
"@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/cameraroll": "^4.0.2",
"@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/viewpager": "4.2.2",
"@react-navigation/bottom-tabs": "^5.11.7",
"@react-navigation/native": "^5.9.2",
"@react-navigation/stack": "^5.14.2",
"@react-navigation/bottom-tabs": "^5.11.8",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"@reduxjs/toolkit": "^1.5.0",
"@sentry/react-native": "^2.1.1",
"@sharcoux/slider": "^5.0.4",
"@sharcoux/slider": "^5.1.3",
"axios": "^0.21.1",
"expo": "^40.0.1",
"expo-auth-session": "~3.0.0",
@ -57,41 +57,41 @@
"expo-store-review": "~2.3.0",
"expo-video-thumbnails": "~4.4.0",
"expo-web-browser": "~8.6.0",
"i18next": "^19.8.5",
"i18next": "^19.9.2",
"li": "^1.3.0",
"lodash": "^4.17.20",
"lodash": "^4.17.21",
"react": "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-animated-spinkit": "^1.5.1",
"react-native-blurhash": "^1.0.29",
"react-native-animated-spinkit": "^1.5.2",
"react-native-blurhash": "^1.1.4",
"react-native-fast-image": "^8.3.4",
"react-native-feather": "^1.0.2",
"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-reanimated": "^2.0.0-rc.2",
"react-native-safe-area-context": "3.1.9",
"react-native-pager-view": "^5.1.2",
"react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~2.18.1",
"react-native-svg": "12.1.0",
"react-native-swipe-list-view": "^3.2.6",
"react-native-tab-view": "^2.15.2",
"react-native-tab-view-viewpager-adapter": "^1.1.0",
"react-native-tab-view": "^3.0.0",
"react-native-unimodules": "~0.12.0",
"react-query": "^3.12.0",
"react-query": "^3.12.1",
"react-redux": "^7.2.2",
"react-timeago": "^5.2.0",
"redux-persist": "^6.0.0",
"rn-placeholder": "^3.0.3",
"sentry-expo": "^3.0.4",
"sentry-expo": "^3.0.5",
"tslib": "^2.1.0"
},
"devDependencies": {
"@babel/core": "~7.12.10",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/preset-typescript": "^7.12.7",
"@expo/config": "^3.3.26",
"@babel/core": "~7.13.10",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@babel/preset-typescript": "^7.13.0",
"@expo/config": "^3.3.31",
"@jest/types": "^26.6.2",
"@testing-library/jest-native": "^3.4.3",
"@testing-library/react-hooks": "^3.7.0",
@ -114,10 +114,10 @@
"jest": "^26.6.3",
"jest-expo": "^40.0.1",
"nock": "^13.0.5",
"react-navigation": "^4.4.3",
"react-navigation-stack": "^2.10.2",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4",
"react-test-renderer": "^16.13.1",
"typescript": "~4.1.3",
"uri-scheme": "^1.0.67"
"typescript": "~4.2.3",
"uri-scheme": "^1.0.68"
}
}
}

View File

@ -5,7 +5,6 @@ import audio from '@root/startup/audio'
import dev from '@root/startup/dev'
import log from '@root/startup/log'
import netInfo from '@root/startup/netInfo'
import onlineStatus from '@root/startup/onlineStatus'
import sentry from '@root/startup/sentry'
import { persistor, store } from '@root/store'
import { getSettingsLanguage } from '@utils/slices/settingsSlice'
@ -28,7 +27,6 @@ dev()
sentry()
audio()
push()
onlineStatus()
log('log', 'react-query', 'initializing')
const queryClient = new QueryClient()

View File

@ -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 {
NavigationContainer,
NavigationContainerRef
@ -22,7 +23,7 @@ import React, { createRef, useCallback, useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import { Alert, Platform, StatusBar } from 'react-native'
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 * as Sentry from 'sentry-expo'
@ -46,18 +47,25 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
const routeNameRef = useRef<string | undefined>()
// const isConnected = useNetInfo().isConnected
// const [firstRender, setFirstRender] = useState(false)
// useEffect(() => {
// if (firstRender) {
// // bug in netInfo on first render as false
// if (isConnected !== false) {
// toast({ type: 'error', content: '手机🈚️网络', autoHide: false })
// }
// } else {
// setFirstRender(true)
// }
// }, [isConnected, firstRender])
const isConnected = useNetInfo().isConnected
useEffect(() => {
switch (isConnected) {
case true:
onlineManager.setOnline(isConnected)
removeMessage()
break
case false:
onlineManager.setOnline(isConnected)
displayMessage({
mode,
type: 'error',
message: t('network.disconnected.message'),
description: t('network.disconnected.description'),
autoHide: false
})
break
}
}, [isConnected])
// Push hooks
const instances = useSelector(
@ -192,3 +200,6 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
}
export default React.memo(Screens, () => true)
function toast (arg0: { type: string; content: string; autoHide: boolean }) {
throw new Error('Function not implemented.')
}

View File

@ -38,7 +38,7 @@ const apiInstance = async <T = unknown>({
domain = state.instances.instances[instanceActive].url
token = state.instances.instances[instanceActive].token
} else {
console.error(
console.warn(
ctx.bgRed.white.bold(' API ') + ' ' + 'No instance domain is provided'
)
return Promise.reject()

View File

@ -3,7 +3,10 @@ import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import { getTheme } from '@utils/styles/themes'
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'
const displayMessage = ({
@ -70,6 +73,10 @@ const displayMessage = ({
})
}
const removeMessage = () => {
hideMessage()
}
const Message = React.memo(
() => {
const { mode, theme } = useTheme()
@ -100,4 +107,4 @@ const Message = React.memo(
() => true
)
export { Message, displayMessage }
export { Message, displayMessage, removeMessage }

View File

@ -1,7 +1,14 @@
export default {
network: {
disconnected: {
message: 'Lost network connection',
description: "Please check your phone's network setting"
}
},
screenshot: {
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'
},
index: {

View File

@ -1,4 +1,10 @@
export default {
network: {
disconnected: {
message: '无法连接到网络',
description: '请检查手机设置里的网络连接'
}
},
screenshot: {
title: '隐私保护',
message: '请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!',

View File

@ -5,12 +5,10 @@ import TimelineDefault from '@components/Timeline/Default'
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
import { ScreenTabsParamList } from '@screens/Tabs'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { getInstanceActive } from '@utils/slices/instancesSlice'
import React, { useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Platform } from 'react-native'
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
import { useSelector } from 'react-redux'
import sharedScreens from './Shared/sharedScreens'
export type TabLocalProp = BottomTabScreenProps<
@ -23,7 +21,6 @@ const Stack = createNativeStackNavigator<Nav.TabLocalStackParamList>()
const TabLocal = React.memo(
({ navigation }: TabLocalProp) => {
const { t } = useTranslation('local')
const instanceActive = useSelector(getInstanceActive)
const screenOptions = useMemo(
() => ({
@ -60,10 +57,7 @@ const TabLocal = React.memo(
[]
)
const children = useCallback(
() =>
instanceActive !== -1 ? (
<Timeline queryKey={queryKey} customProps={{ renderItem }} />
) : null,
() => <Timeline queryKey={queryKey} customProps={{ renderItem }} />,
[]
)

View File

@ -4,19 +4,15 @@ import Timeline from '@components/Timeline'
import TimelineDefault from '@components/Timeline/Default'
import SegmentedControl from '@react-native-community/segmented-control'
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
import { useNavigation } from '@react-navigation/native'
import { ScreenTabsParamList } from '@screens/Tabs'
import sharedScreens from '@screens/Tabs/Shared/sharedScreens'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { getInstanceActive } from '@utils/slices/instancesSlice'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Dimensions, StyleSheet } from 'react-native'
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
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<
ScreenTabsParamList,
@ -29,7 +25,6 @@ const TabPublic = React.memo(
({ navigation }: TabPublicProps) => {
const { t, i18n } = useTranslation()
const { mode } = useTheme()
const instanceActive = useSelector(getInstanceActive)
const [segment, setSegment] = useState(0)
const pages: {
@ -82,10 +77,7 @@ const TabPublic = React.memo(
)
const routes = pages.map(p => ({ key: p.key }))
const renderPager = useCallback(
props => <ViewPagerAdapter {...props} />,
[]
)
const renderScene = useCallback(
({
route: { key: page }
@ -103,20 +95,19 @@ const TabPublic = React.memo(
[]
)
const children = useCallback(
() =>
instanceActive !== -1 ? (
<TabView
lazy
swipeEnabled
renderPager={renderPager}
renderScene={renderScene}
renderTabBar={() => null}
onIndexChange={index => setSegment(index)}
navigationState={{ index: segment, routes }}
initialLayout={{ width: Dimensions.get('screen').width }}
/>
) : null,
[segment, instanceActive]
() => (
// @ts-ignore
<TabView
lazy
swipeEnabled
renderScene={renderScene}
renderTabBar={() => null}
onIndexChange={index => setSegment(index)}
navigationState={{ index: segment, routes }}
initialLayout={{ width: Dimensions.get('screen').width }}
/>
),
[segment]
)
return (

View File

@ -13,6 +13,7 @@ const netInfo = async (): Promise<{
corrupted?: string
}> => {
log('log', 'netInfo', 'initializing')
const netInfo = await NetInfo.fetch()
const instance = getInstance(store.getState())

View File

@ -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

1080
yarn.lock

File diff suppressed because it is too large Load Diff