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
F3392082: D6112.id20464.diff
Sat, Nov 30, 6:56 AM
Unknown Object (File)
Wed, Nov 27, 12:14 PM
Unknown Object (File)
Sat, Nov 23, 9:59 PM
Unknown Object (File)
Sat, Nov 23, 8:41 PM
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
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