mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Remove expo-updates unfortunately
As now it starts charging
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import * as Updates from 'expo-updates'
|
||||
import Constants from 'expo-constants'
|
||||
|
||||
const mapEnvironment = <T = unknown>({
|
||||
release,
|
||||
@ -36,14 +36,14 @@ const mapEnvironment = <T = unknown>({
|
||||
|
||||
const isDevelopment =
|
||||
__DEV__ ||
|
||||
['development'].some(channel => (Updates.channel) === channel)
|
||||
['development'].some(channel => (Constants.expoConfig?.extra?.environment) === channel)
|
||||
|
||||
const isCandidate = ['candidate'].some(channel =>
|
||||
(Updates.channel) === channel
|
||||
(Constants.expoConfig?.extra?.environment) === channel
|
||||
)
|
||||
|
||||
const isRelease = ['release'].some(channel =>
|
||||
(Updates.channel) === channel
|
||||
(Constants.expoConfig?.extra?.environment) === channel
|
||||
)
|
||||
|
||||
export { mapEnvironment, isDevelopment, isCandidate, isRelease }
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import { RootState } from '@root/store'
|
||||
import * as Updates from 'expo-updates'
|
||||
import Constants from 'expo-constants'
|
||||
import * as StoreReview from 'expo-store-review'
|
||||
|
||||
export type ContextsState = {
|
||||
@ -38,7 +38,7 @@ const contextsSlice = createSlice({
|
||||
initialState: contextsInitialState as ContextsState,
|
||||
reducers: {
|
||||
updateStoreReview: (state, action: PayloadAction<1>) => {
|
||||
if (Updates.channel === 'release') {
|
||||
if (Constants.expoConfig?.extra?.environment === 'release') {
|
||||
state.storeReview.current = state.storeReview.current + action.payload
|
||||
if (state.storeReview.current === state.storeReview.context) {
|
||||
StoreReview?.isAvailableAsync().then(() =>
|
||||
|
Reference in New Issue
Block a user