Fix issue with trying to click and drag on full screen milkdrop.

Sentry: WINAMP2-JS-PROD-BW
This commit is contained in:
Jordan Eldredge 2019-01-05 16:37:05 -08:00
parent a59a471f8d
commit 7f469cb13e

View file

@ -36,7 +36,7 @@ class WindowManager extends React.Component<Props> {
);
const targetNode = windows.find(node => node.key === key);
if (targetNode == null) {
throw new Error("Tried to move a node that does not exist");
throw new Error(`Tried to move a node that does not exist: ${key}`);
}
let movingSet = new Set([targetNode]);
@ -56,6 +56,11 @@ class WindowManager extends React.Component<Props> {
if (!(e.target as HTMLElement).classList.contains("draggable")) {
return;
}
if (this.props.getWindowHidden(key)) {
// The user may be clicking on full screen Milkdrop.
return;
}
// Prevent dragging from highlighting text.
e.preventDefault();