This commit is contained in:
Mateusz Gruszczyński committed 2026-10-26 15:47:16 +01:00
1 parent f508b7c882
commit 25d04daaee
12 files changed
+323 -90

No files matched your search

+11 -5
View File
@@ -266,11 +266,17 @@ async function toggleNoteFavorite(button) {
{ title: t("favorites.title", {}, "Favorites") },
);
} catch (error) {
if (error.status === 401 || error.status === 403) {
const session = await validateCurrentSession();
if (!session) {
accountSession = null;
renderNotes();
// The API client already rechecks the session after a 401.
// Only a 403 needs an additional check for an unrelated access restriction.
if (error.status === 403) {
try {
const session = await validateCurrentSession();
if (!session) {
accountSession = null;
renderNotes();
}
} catch {
// A failed recheck is not evidence that the account session expired.
}
}
toast.danger(error.message, { title: t("favorites.updateFailed", {}, "Could not update favorites") });