diff --git a/Interface.tsx b/Interface.tsx index 4ee4d0c..cc4cdc5 100644 --- a/Interface.tsx +++ b/Interface.tsx @@ -1,12 +1,11 @@ -import React, { createContext, useContext, useState, useEffect } from 'react'; import axios from 'axios'; -import { SettingsContext } from './SettingsProvider'; +import { encode as btoa } from 'base-64'; import { format } from 'date-fns'; -import Settings from './screens/Settings'; -import { ThemeButton, ThemeText } from './common/ThemeTypes'; +import React, { createContext, useContext, useEffect, useState } from 'react'; import { StyleSheet, Text, View } from 'react-native'; +import { SettingsContext } from './SettingsProvider'; +import { ThemeButton, ThemeText } from './common/ThemeTypes'; import { useColors } from './common/colors'; -import { decode as atob, encode as btoa } from 'base-64' import Login from './screens/Login'; export const InterfaceContext = createContext(null); @@ -17,6 +16,7 @@ const Interface = ({ children }) => { const [userInformation, setUserInformation] = useState(null); const [baseData, setBaseData] = useState(null); const [loading, setLoading] = useState(true); + const [initialLoading, setInitialLoading] = useState(true); const [error, setError] = useState(false); const [errorObject, setErrorObject] = useState(null); @@ -37,6 +37,7 @@ const Interface = ({ children }) => { setError(true) } finally { setLoading(false) + setInitialLoading(false) } } @@ -175,7 +176,7 @@ const Interface = ({ children }) => { ) - if (!loading) return (children) + if (!initialLoading) return (children) } return ( diff --git a/screens/Settings.tsx b/screens/Settings.tsx index 27a1edf..6033699 100644 --- a/screens/Settings.tsx +++ b/screens/Settings.tsx @@ -1,7 +1,6 @@ import FontAwesome5 from '@expo/vector-icons/FontAwesome5'; -import * as Application from 'expo-application'; import { useContext, useEffect, useRef, useState } from 'react'; -import { ActivityIndicator, Alert, Animated, Button, Image, Linking, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { ActivityIndicator, Alert, Animated, Button, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import ErrorBoundary from 'react-native-error-boundary'; import { SettingsContext } from '../SettingsProvider'; import Credits from '../common/Credits'; @@ -55,10 +54,6 @@ const Settings = () => { } }; - const handleLinkPress = (url) => { - Linking.openURL(url); - }; - const handleChange = (setter) => (value) => { setter(value); showToast(ToastType.Warn, 'Ungespeicherte Änderungen');