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

Use in-memory global values

As connect needs to be read very often
This commit is contained in:
xmflsct
2023-01-29 19:02:47 +01:00
parent ebe57be674
commit 5c3e490112
5 changed files with 22 additions and 14 deletions

View File

@ -24,6 +24,10 @@ import { enableFreeze } from 'react-native-screens'
import i18n from './i18n'
import Screens from './screens'
export const GLOBAL: { connect?: boolean } = {
connect: undefined
}
Platform.select({
android: LogBox.ignoreLogs(['Setting a timer for a long period of time'])
})
@ -54,6 +58,7 @@ const App: React.FC = () => {
}
const useConnect = getGlobalStorage.boolean('app.connect')
GLOBAL.connect = useConnect
log('log', 'App', `connect: ${useConnect}`)
if (useConnect) {
await connectVerify()