From 2ca44171b9c22c259bb9b45fee3f6515a107c52e Mon Sep 17 00:00:00 2001 From: TenType <55125103+TenType@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:09:43 -0700 Subject: [PATCH] Show a different error with 401 on upload --- src/components/UploadButton.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/UploadButton.js b/src/components/UploadButton.js index eecac9a..77be3a5 100644 --- a/src/components/UploadButton.js +++ b/src/components/UploadButton.js @@ -143,6 +143,23 @@ export default function UploadButton({ "File upload aborted", "Your file could not be uploaded due to a connection error. Please check your Internet connection and try again.", ); + } else if (error.__response?.status == 401) { + Alert.alert( + "Invalid Session", + "Your authentication session is malformed, most likely because your device has old data that is not compatible with the current version of the app. To fix this issue, please go to your profile, clear your data, and log in again with your Google account. We apologize for the inconvenience.", + [ + { + text: "Go to Profile", + onPress: () => { + navigation.navigate("Account"); + }, + }, + { + text: "Cancel", + isPreferred: true, + }, + ], + ); } else if (error.__response?.status == 403) { Alert.alert( "Permission Denied",