Update CustomStatusPresets.plugin.js

This commit is contained in:
Mirco Wittrien 2021-02-07 22:36:14 +01:00 committed by GitHub
parent e0012596bc
commit 2eea3786c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -149,7 +149,8 @@ module.exports = (_ => {
document.removeEventListener("mouseup", mouseUp);
let dragging = event3 => {
this.updateDragPreview(event3);
let hoveredId = BDFDB.DOMUtils.getParent(BDFDB.dotCN._customstatuspresetssortablecard, event3.target)?.getAttribute("cardId");
let hoveredId = BDFDB.DOMUtils.getParent(BDFDB.dotCN._customstatuspresetssortablecard, event3.target);
hoveredId = hoveredId && hoveredId.getAttribute("cardId");
let update = hoveredId != this.props.hovered;
this.props.hovered = hoveredId;
if (update) BDFDB.ReactUtils.forceUpdate(this);
@ -511,4 +512,4 @@ module.exports = (_ => {
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(config));
})();
})();