Skip to content

Commit

Permalink
Merge pull request #120 from deco-sites/fix/localStorage-clear
Browse files Browse the repository at this point in the history
Fix/local storage clear
  • Loading branch information
riquexcosta authored Nov 14, 2024
2 parents 4122bf8 + 660f800 commit f377740
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/ui/PrescriberPatientsLive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function PrescriberPatients() {
} catch (error) {
console.error("Erro ao carregar dados:", error);
if (IS_BROWSER) {
localStorage.setItem("AccessToken", "");
localStorage.setItem("PrescriberAccessToken", "");
}
window.location.href = "/";
}
Expand Down
1 change: 1 addition & 0 deletions components/ui/PrescriberSignout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function Signout({ redirectTo = "/" }) {
});
if (IS_BROWSER) {
localStorage.setItem("PrescriberAccessToken", "");
localStorage.clear();
}
window.location.href = redirectTo;
} catch (e) {
Expand Down
3 changes: 2 additions & 1 deletion components/ui/PrivatePageControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function PrivatePageControl(_props: Props) {
window.location.href = r.dataProfile.lecoupon_smartLink;
} else if (
window.location.pathname === "/clube-de-beneficios" &&
currentPlan === "CARD_PARTNER" &&
["CARD_PARTNER", "CARD_ASSOCIATED"].includes(currentPlan) &&
r.dataProfile.lecoupon_free_month_date &&
r.dataProfile.lecoupon_smartLink
) {
Expand All @@ -109,6 +109,7 @@ function PrivatePageControl(_props: Props) {
console.error("Erro ao carregar dados:", error);
if (IS_BROWSER) {
localStorage.setItem("AccessToken", "");
localStorage.clear();
}
window.location.href = "/";
}
Expand Down
1 change: 1 addition & 0 deletions components/ui/Signout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function Signout(_props: Props) {
if (IS_BROWSER) {
localStorage.setItem("AccessToken", "");
localStorage.setItem("currentPatientPlan", "");
localStorage.clear();
}
window.location.href = "/";
} catch (e) {
Expand Down

0 comments on commit f377740

Please sign in to comment.