Page MenuHomePhabricator

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

Authored by ashoat on Dec 29 2022, 6:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 6:32 AM
Unknown Object (File)
Wed, Nov 6, 6:32 AM
Unknown Object (File)
Sat, Nov 2, 7:36 PM
Unknown Object (File)
Sat, Nov 2, 7:36 PM
Unknown Object (File)
Sat, Nov 2, 7:36 PM
Unknown Object (File)
Sat, Nov 2, 7:34 PM
Unknown Object (File)
Tue, Oct 29, 4:09 PM
Unknown Object (File)
Oct 7 2024, 2:08 AM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable