HomePhabricator
Diffusion Comm 6b69e02143e5

[landing] Add localStorage.clear() call to landing/script.js

Description

[landing] Add localStorage.clear() call to landing/script.js

Summary:
landing/script.js is the Webpack entrypoint for the browser build, and doesn't execute in the SSR context (where localStorage is not defined).

We're doing this to address ENG-2577. We want to reset state on every render, and state in wagmi, RainbowKit, and walletconnect is all persisted via localStorage.

In that issue we found that as soon as we import walletconnect (transitively through wagmi and RainbowKit), it checks localStorage. So in order to clear localStorage before that, we want to make sure we execute localStorage.clear() at the very start.

This has the side effect of clearing localStorage for the rest of landing, but we don't use it (I think) so we should be good.

Depends on D6111

Test Plan: Test end-to-end flow on a physical Android device

Reviewers: atul

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D6112

Details

Provenance
ashoatAuthored on Dec 29 2022, 6:42 PM
Reviewer
atul
Differential Revision
D6112: [landing] Add localStorage.clear() call to landing/script.js
Parents
rCOMM8c016d1beb79: [landing] Revert RainbowKit patch in D6018
Branches
Unknown
Tags
Unknown