Skip to content

Commit

Permalink
Show a different error with 401 on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TenType committed Oct 8, 2024
1 parent 91dd8e7 commit 2ca4417
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/UploadButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2ca4417

Please sign in to comment.