0.2.94
This commit is contained in:
1 parent
f508b7c882
commit
25d04daaee
12 files changed
+323
-90
No files matched your search
+11
-5
@@ -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") });
|
||||
|
||||
Reference in new issue
Block a user