Closed lightlii closed 1 year ago
ok looks like versioning might be better handled in the conf store? looking at the migrations section here
added another commit with some types on the store. Not sure they're any good though, Zustand's typescript docs are a bit vague unfortunately...
Ok I'm slightly more confident in my typings now but still need someone to look over them
after a little back and forth with @gmaclennan on slack we've decided to replace conf
with electron-store. It uses conf under the hood so is theoretically compatible with current persisted configs. I'll go ahead and use this PR to make that change I think since it's so small
lastly, since we now have a means of persisting state through zustand I suggest removing the createPersistedState
. It would be less confusing to have only a single way of persisting state in the app. There's only a single use of it in the app so its a very minor change and again I can roll it into this PR if you agree @ErikSin ?
I haven't been able to confirm it's fully compatible with existing persisted configs but the only thing we're saving is the active tab so at worst user won't see their last tab once when opening the next update which I'd argue is an acceptable trade-off
That sounds good! Thanks @lightlii
Contributor checklist:
npm install --package-lock
Description
Adds zustand state store with persistence using our current conf store. Versioning is achieved with a
STORE_VERSION
constant applied to the store, not sure if this is the best way, open to feedback.closes https://github.com/digidem/mapeo-desktop/issues/735