Gracefully handle mutuals 403 error

This commit is contained in:
Natsumi
2025-12-04 13:57:14 +13:00
parent 3e7b12ab2b
commit aded54a263
2 changed files with 17 additions and 13 deletions
+3
View File
@@ -307,6 +307,9 @@ export function $throw(code, error, endpoint) {
if (endpoint?.startsWith('analysis/')) { if (endpoint?.startsWith('analysis/')) {
ignoreError = true; ignoreError = true;
} }
if (endpoint.endsWith('/mutuals') && (code === 403 || code === -1)) {
ignoreError = true;
}
if (text.length && !ignoreError) { if (text.length && !ignoreError) {
if (AppDebug.errorNoty) { if (AppDebug.errorNoty) {
AppDebug.errorNoty.close(); AppDebug.errorNoty.close();
+4 -3
View File
@@ -964,6 +964,7 @@ export const useUserStore = defineStore('User', () => {
} }
}); });
if (!currentUser.value.hasSharedConnectionsOptOut) { if (!currentUser.value.hasSharedConnectionsOptOut) {
try {
userRequest userRequest
.getMutualCounts({ userId }) .getMutualCounts({ userId })
.then((args) => { .then((args) => {
@@ -973,10 +974,10 @@ export const useUserStore = defineStore('User', () => {
D.mutualGroupCount = D.mutualGroupCount =
args.json.groups; args.json.groups;
} }
})
.catch((error) => {
console.error(error);
}); });
} catch (error) {
console.error(error);
}
} }
} else { } else {
D.previousDisplayNames = D.previousDisplayNames =