mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-28 16:14:33 +02:00
🐛 Check items exist before itterating #415
This commit is contained in:
parent
b76b8eb620
commit
f25aa07d5f
@ -70,8 +70,10 @@ const store = new Vuex.Store({
|
|||||||
getItemById: (state, getters) => (id) => {
|
getItemById: (state, getters) => (id) => {
|
||||||
let item;
|
let item;
|
||||||
getters.sections.forEach(sec => {
|
getters.sections.forEach(sec => {
|
||||||
|
if (sec.items) {
|
||||||
const foundItem = sec.items.find((itm) => itm.id === id);
|
const foundItem = sec.items.find((itm) => itm.id === id);
|
||||||
if (foundItem) item = foundItem;
|
if (foundItem) item = foundItem;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user