fix: harden favorite state consistency

This commit is contained in:
Chengdong Zhang
2026-09-21 19:13:10 +08:00
parent a4ef6ca49e
commit 0b594c0147
4 changed files with 108 additions and 28 deletions
+3 -1
View File
@@ -251,7 +251,9 @@ const toggleFavorite = async (): Promise<void> => {
}
} catch (error) {
if (error instanceof ApiError && error.status === 401) {
await signInThenReturn();
if (version === favoriteRequestVersion && product.value?.id === current.id) {
await signInThenReturn();
}
return;
}
if (version === favoriteRequestVersion && product.value?.id === current.id) {