emotz / kladovka

Optimizer of inventory for games
http://kladovka.herokuapp.com/
MIT License
0 stars 0 forks source link

frontend console error when not authenticated and more than one item added #123

Open Eoksni opened 7 years ago

Eoksni commented 7 years ago

screenshot from 2017-09-19 11-35-59

it is because of

local.mounted = function (component) {
    for (let id in localStorage) {
        if (id === 'user' || id === 'token' || id === 'char') continue; // `showIcon` is there somehow
        let item = localStorage.getItem(id);
        component.addItem(JSON.parse(item));
    }
};

in kl-items.method.js

Instead of directly using id as key, we should prefix it with something, like so item-${id}, eg item-re1231dq12