1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-01-27 00:35:34 +01:00
parent 9ae1612a96
commit 41bfeed56f
24 changed files with 558 additions and 457 deletions

View File

@ -1,22 +1,12 @@
import client from '@api/client'
import { AxiosError } from 'axios'
import Constants from 'expo-constants'
import * as AuthSession from 'expo-auth-session'
import { useQuery, UseQueryOptions } from 'react-query'
export type QueryKey = ['Apps', { instanceDomain?: string }]
const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
let redirectUri: string
switch (Constants.manifest.releaseChannel) {
case 'production':
case 'staging':
case 'testing':
redirectUri = 'tooot://expo-auth-session'
break
default:
redirectUri = 'exp://127.0.0.1:19000'
break
}
const redirectUri = AuthSession.makeRedirectUri({ useProxy: false })
const { instanceDomain } = queryKey[1]

View File

@ -38,7 +38,7 @@ const contextsSlice = createSlice({
initialState: contextsInitialState as ContextsState,
reducers: {
updateStoreReview: (state, action: PayloadAction<1>) => {
if (Constants.manifest.releaseChannel === 'production') {
if (Constants.manifest.releaseChannel?.includes('production')) {
state.storeReview.current = state.storeReview.current + action.payload
if (state.storeReview.current === state.storeReview.context) {
StoreReview.isAvailableAsync().then(() => StoreReview.requestReview())

View File

@ -3,8 +3,6 @@ import { RootState } from '@root/store'
import * as Analytics from 'expo-firebase-analytics'
import * as Localization from 'expo-localization'
export const supportedLngs = ['zh-Hans', 'en']
export type SettingsState = {
language: 'zh-Hans' | 'en'
theme: 'light' | 'dark' | 'auto'