Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(localStorage error): do not crash if error "Failed to read the 'localStorage' property from 'Window': Access is denied for this document." is thrown #5999

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

…ocalStorage' property from 'Window': Access is denied for this document." is thrown
@@ -85,8 +84,12 @@ const createCommonAgreementStore: StoreSlicePublicode<
},
onRouteChange: (value) => {
if (value === "not-selected") {
if (window.localStorage) {
window.localStorage.removeItem(STORAGE_KEY_AGREEMENT);
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

le fix c'est juste d'ajouter un try/catch

);
} else {
window.localStorage.removeItem(STORAGE_KEY_AGREEMENT);
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ici aussi

@carolineBda carolineBda requested review from Viczei, maxgfr and m-maillot and removed request for Viczei and maxgfr June 27, 2024 10:05
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Member

@maxgfr maxgfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top merci !!!

@maxgfr
Copy link
Member

maxgfr commented Jun 27, 2024

@carolineBda Il faudrait limite passer sur chaque window.localStorage pour voir si ils sont bien dans les try/catch

@carolineBda
Copy link
Contributor Author

@carolineBda Il faudrait limite passer sur chaque window.localStorage pour voir si ils sont bien dans les try/catch

Oui j'ai fait ça, t'en a vu que j'ai oublié ?

@maxgfr
Copy link
Member

maxgfr commented Jun 27, 2024

@carolineBda Nop, je demandais juste

@carolineBda carolineBda merged commit fa29fd5 into dev Jun 27, 2024
23 checks passed
@carolineBda carolineBda deleted the carolineBda/fix-localStorage-error branch June 27, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants