Skip to content

Commit

Permalink
pretty code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaetanbrl committed Nov 27, 2024
1 parent e72d05b commit 155409e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ var mv = (function () {
layerid = el.attr("data-layerid");
}
var themeid = mv.getCurrentThemeId();
if(!themeid) {
if (!themeid) {
// search theme id from config object
themeid = Object.keys(config.themes).filter(f => {
const them = config.themes[f];
return them.layers.filter(l => l.id === layerid)?.length;
}).filter(x => x)[0]
themeid = Object.keys(config.themes)
.filter((f) => {
const them = config.themes[f];
return them.layers.filter((l) => l.id === layerid)?.length;
})
.filter((x) => x)[0];
}
return config.themes[themeid].layers.find((l) => l.id === layerid);
},
Expand Down

0 comments on commit 155409e

Please sign in to comment.