Update SpotifyControls.plugin.js

This commit is contained in:
Mirco Wittrien 2021-07-29 22:33:44 +02:00
parent bd2edd23cb
commit 07f975b967
1 changed files with 3 additions and 21 deletions

View File

@ -681,19 +681,6 @@ module.exports = (_ => {
}
onStart () {
// REMOVE 24.04.2021
let oldData = BDFDB.DataUtils.load(this);
if (oldData.settings) {
this.settings.general = oldData.settings;
BDFDB.DataUtils.save(this.settings.general, this, "general");
BDFDB.DataUtils.remove(this, "settings");
}
if (oldData.buttonConfigs) {
this.settings.buttons = oldData.buttonConfigs;
BDFDB.DataUtils.save(this.settings.buttons, this, "buttons");
BDFDB.DataUtils.remove(this, "buttonConfigs");
}
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SpotifyTrackUtils, "getActivity", {after: e => {
if (e.methodArguments[0] !== false) {
if (e.returnValue && e.returnValue.name == "Spotify") this.updatePlayer(e.returnValue);
@ -709,11 +696,11 @@ module.exports = (_ => {
return false;
}});
this.forceUpdateAll();
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop () {
this.forceUpdateAll();
BDFDB.PatchUtils.forceAllUpdates(this);
}
getSettingsPanel (collapseStates = {}) {
@ -798,14 +785,9 @@ module.exports = (_ => {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
BDFDB.PatchUtils.forceAllUpdates(this);
}
}
forceUpdateAll () {
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.DiscordUtils.rerenderAll();
}
processAnalyticsContext (e) {
if (e.instance.props.section == BDFDB.DiscordConstants.AnalyticsSections.ACCOUNT_PANEL) e.instance.props.children = [