Update SpotifyControls.plugin.js

This commit is contained in:
Mirco Wittrien 2020-07-21 15:12:43 +02:00
parent 37c484a49f
commit fae525eeef
1 changed files with 5 additions and 3 deletions

View File

@ -124,7 +124,7 @@ var SpotifyControls = (_ => {
updateInterval = BDFDB.TimeUtils.interval(_ => {
if (!this.updater || typeof this.updater.isMounted != "function" || !this.updater.isMounted(this)) BDFDB.TimeUtils.clear(updateInterval);
else if (this.props.running) {
let song = BDFDB.LibraryModules.SpotifyTrackUtils.getActivity();
let song = BDFDB.LibraryModules.SpotifyTrackUtils.getActivity(false);
if (!song) BDFDB.ReactUtils.forceUpdate(controls);
else if (this.props.running) BDFDB.ReactUtils.forceUpdate(this);
}
@ -300,8 +300,10 @@ var SpotifyControls = (_ => {
BDFDB.PluginUtils.init(this);
BDFDB.ModuleUtils.patch(this, BDFDB.LibraryModules.SpotifyTrackUtils, "getActivity", {after: e => {
if (e.returnValue && e.returnValue.name == "Spotify") this.updatePlayer(e.returnValue);
else if (!e.returnValue) this.updatePlayer(null);
if (e.methodArguments[0] !== false) {
if (e.returnValue && e.returnValue.name == "Spotify") this.updatePlayer(e.returnValue);
else if (!e.returnValue) this.updatePlayer(null);
}
}});
BDFDB.ModuleUtils.patch(this, BDFDB.LibraryModules.SpotifyTrackUtils, "wasAutoPaused", {instead: e => {