demoinformation

This commit is contained in:
2024-09-15 16:50:22 +02:00
parent d59e854b79
commit 5495cf59a5
4 changed files with 1306 additions and 658 deletions

View File

@@ -69,7 +69,11 @@ const Interface = ({ children }) => {
};
const fetchUserInformation = async (username) => {
return await requestGet(`userinformation/?username=${username}`);
const userinformation = await requestGet(`userinformation/?username=${username}`, false);
if (!userinformation) {
return await requestGet(`demoinformation/`);
}
return userinformation;
};
const fetchTimes = async () => {
@@ -103,7 +107,7 @@ const Interface = ({ children }) => {
};
const requestGet = async (url) => {
const requestGet = async (url, handleError = true) => {
try {
const response = await axiosInstance.get(url);
if (response.status === 200 && response.data.success === true) {
@@ -112,7 +116,9 @@ const Interface = ({ children }) => {
throw new InterfaceError(response.data.message);
}
} catch (error) {
if (error.response) {
if (!handleError) {
return null
}else if (error.response) {
if (error.response.data.message){
throw new InterfaceError(error.response.status + ": " + error.response.data.message);
}else if (error.response.status === 404) {

View File

@@ -100,9 +100,6 @@ export const ThemeTextInput = ({ style, value, disabled, onValueChange, secureTe
flex: 1,
paddingVertical: 10,
paddingRight: 10,
// @ts-expect-error - Für Web, TS kennt outlineStyle nicht
outlineStyle: 'none',
backgroundColor: colors.backPrimary,
color: disabled ? colors.textDisabled : colors.text,
},

1947
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
"base-64": "^1.0.0",
"crypto-browserify": "^3.12.0",
"date-fns": "^3.6.0",
"expo": "~50.0.20",
"expo": "^51.0.32",
"expo-application": "~5.8.4",
"expo-build-properties": "~0.11.1",
"expo-status-bar": "~1.11.1",