diff --git a/js/components/App.js b/js/components/App.js index 2812b3e1..d26e85a0 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -19,18 +19,12 @@ const App = ({ genWindowsInfo, container, filePickers, - genWindows = [] + genWindowComponents }) => { if (closed) { return null; } - // Index genWindows by id - const genWindowComponents = genWindows.reduce( - (comps, gen) => ({ ...comps, [gen.id]: gen }), - {} - ); - const windows = objectMap(genWindowsInfo, (w, id) => { switch (id) { case "main": @@ -45,10 +39,10 @@ const App = ({ if (!w.generic) { throw new Error("Tried to render an unknown window:", id); } - const { Component, title } = genWindowComponents[id]; + const Component = genWindowComponents[id]; return ( w.open && ( - + {({ height, width }) => ( ({ closed: state.display.closed, - mainWindow: state.windows.mainWindow, - equalizer: state.windows.equalizer, genWindowsInfo: state.windows.genWindows }); diff --git a/js/webamp.js b/js/webamp.js index 47a25312..2ea42f86 100644 --- a/js/webamp.js +++ b/js/webamp.js @@ -135,13 +135,18 @@ class Winamp { // Wait for the skin to load. await storeHas(this.store, state => !state.display.loading); + const genWindowComponents = {}; + this.genWindows.forEach(w => { + genWindowComponents[w.id] = w.Component; + }); + render( , node