Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:alien: Add getter to return specific item

Alicia Sykes36cea32ee59d
diff --git a/src/store.js b/src/store.js
index 306c80ef..2b2ce518 100644
--- a/src/store.js
+++ b/src/store.js
@@ -35,6 +35,14 @@ const store = new Vuex.Store({
visibleComponents(state, getters) {
return componentVisibility(getters.appConfig);
},
+ getItemById: (state, getters) => (id) => {
+ let item;
+ getters.sections.forEach(sec => {
+ const foundItem = sec.items.find((itm) => itm.id === id);
+ if (foundItem) item = foundItem;
+ });
+ return item;
+ },
},
mutations: {
[UPDATE_CONFIG](state, config) {