1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Preparing for CI test

This commit is contained in:
Zhiyuan Zheng
2021-02-02 22:50:38 +01:00
parent b8aa402c99
commit 1a5b21d56a
54 changed files with 641 additions and 448 deletions

View File

@ -1,6 +1,6 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { RootState } from '@root/store'
import Constants from 'expo-constants'
import * as Updates from 'expo-updates'
import * as StoreReview from 'expo-store-review'
export const supportedLngs = ['zh-Hans', 'en']
@ -38,7 +38,7 @@ const contextsSlice = createSlice({
initialState: contextsInitialState as ContextsState,
reducers: {
updateStoreReview: (state, action: PayloadAction<1>) => {
if (Constants.manifest.releaseChannel?.includes('production')) {
if (Updates.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

@ -175,15 +175,13 @@ const instancesSlice = createSlice({
name: 'instances',
initialState: instancesInitialState,
reducers: {
localUpdateActiveIndex: (
state,
action: PayloadAction<NonNullable<InstancesState['local']['activeIndex']>>
) => {
if (action.payload < state.local.instances.length) {
state.local.activeIndex = action.payload
} else {
throw new Error('Set index cannot be found')
}
localUpdateActiveIndex: (state, action: PayloadAction<InstanceLocal>) => {
state.local.activeIndex = state.local.instances.findIndex(
instance =>
instance.url === action.payload.url &&
instance.token === action.payload.token &&
instance.account.id === action.payload.account.id
)
},
localUpdateAccount: (
state,