digidem / mapeo-desktop

Local-first mapping and monitoring in remote environments
https://mapeo.app
GNU General Public License v3.0
261 stars 33 forks source link

Ej/fix persisted store #746

Closed lightlii closed 1 year ago

lightlii commented 1 year ago

Quick fix, reinstates async await syntax when getting an item from the store.

I've also made the config store consistent since zustand was stringifying the store upon save wheras by default the lib stores it as json which was resulting in configs that look like this:


{
    "experiments-flags": "{\"state\":{\"backgroundMaps\":false},\"version\":0}",
    "background-maps": "{\"state\":{\"mapStyle\":\"\"},\"version\":0}",
    "ui": "{\"state\":{\"tabIndex\":0},\"version\":0}",
    "state": {
        "maximize": false,
        "fullscreen": false,
        "defaultWidth": 1000,
        "defaultHeight": 800,
        "isMaximized": false,
        "show": false,
        "x": 2199,
        // etc.
    }
}
ErikSin commented 1 year ago

You can just get rid of the typings for getItem, setItem, and removeItem, and then you can merge