diff --git a/js/components/App.js b/js/components/App.js index 4e773308..5ae96674 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -35,7 +35,7 @@ const App = ({ genWindows.forEach(genWindow => { const { id, title, Component } = genWindow; if (genWindowsInfo[id].open) { - windows[`genWindow${id}`] = ( + windows[id] = ( {({ height, width }) => ( + getWindowPixelSize(genWindow.size) + ); + return { main, equalizer, playlist, ...genWindowSizes }; } export const getWindowGraph = createSelector( diff --git a/js/utils.js b/js/utils.js index 114deda8..78480fb4 100644 --- a/js/utils.js +++ b/js/utils.js @@ -245,3 +245,9 @@ let counter = 0; export function uniqueId() { return counter++; } + +export function objectMap(obj, cb) { + const modified = {}; + Object.keys(obj).forEach(key => (modified[key] = cb(obj[key]))); + return modified; +}