There's been a lot of weirdness with localstorage, stemming from two issues:
Stuff we don't want being written to localstorage (private methods, recursively duplicated properties)
The useLocalStorageEarthstarSettings updating itself whenever localstorage was written to, which was often as it happens on every document write. This had the effect of rerendering any component it was used in, which is often the entire app.
This PR makes the following changes:
Rewrites useLocalStorageEarthstarSettings to use the native localStorage API.
This has the effect of making it so that this hook does not detect when values in localstorage update.
Rewrite LocalStorageSettingsWriter so that it serialises storages properly, and writes to localstorage when it is expected to.
There's been a lot of weirdness with localstorage, stemming from two issues:
useLocalStorageEarthstarSettings
updating itself whenever localstorage was written to, which was often as it happens on every document write. This had the effect of rerendering any component it was used in, which is often the entire app.This PR makes the following changes:
useLocalStorageEarthstarSettings
to use the native localStorage API.LocalStorageSettingsWriter
so that it serialises storages properly, and writes to localstorage when it is expected to.useLocalStorageEarthstarSettings
.This should close #50 and #51.