Make it safe to reparent the #webamp node

For now users can't control where Webamp inserts itself into the DOM. We want to add that as and option. In the mean time, we can enable users to hack it.

For example, https://github.com/ShizukuIchi/winXP wants to be able to keep Webamp in a div in order to control how it gets layerd with other apps.
This commit is contained in:
Jordan Eldredge 2019-04-05 07:34:14 -07:00
parent 2fb9d38f44
commit f45a3ec3f3

View file

@ -42,7 +42,10 @@ class App extends React.Component {
componentWillUnmount() {
window.removeEventListener("resize", this._handleWindowResize);
document.body.removeChild(this._webampNode);
const parentNode = this._webampNode.parentNode;
if (parentNode != null) {
parentNode.removeChild(this._webampNode);
}
}
componentDidMount() {