show more user-friendly messages when some features are disabled

This commit is contained in:
MaysWind
2025-12-12 13:17:34 +08:00
parent 89dd306bb4
commit 1eb958a21b
21 changed files with 219 additions and 3 deletions
@@ -212,6 +212,8 @@ import { useUserExternalAuthStore } from '@/stores/userExternalAuth.ts';
import { useTokensStore } from '@/stores/token.ts';
import { itemAndIndex, reversedItemAndIndex } from '@/core/base.ts';
import { KnownErrorCode } from '@/consts/api.ts';
import { type UserExternalAuthInfoResponse } from '@/models/user_external_auth.ts';
import { type TokenInfoResponse, SessionDeviceType, SessionInfo } from '@/models/token.ts';
@@ -440,7 +442,10 @@ function reloadExternalAuth(silent?: boolean): void {
}).catch(error => {
loadingExternalAuth.value = false;
if (!error.processed) {
if (error.error && error.error.errorCode === KnownErrorCode.ApiNotFound) {
externalAuths.value = [];
} else if (!error.processed) {
externalAuths.value = [];
snackbar.value?.showError(error);
}
});