mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-24 06:15:48 +02:00
Tweak plugin system to not trigger enabled()/disabled() if requiresPageReload is true
This commit is contained in:
parent
790d1787fd
commit
dfd987041a
@ -49,19 +49,26 @@
|
||||
}
|
||||
|
||||
setState(plugin, enable){
|
||||
let reloading = plugin.obj.$pluginSettings.requiresPageReload;
|
||||
|
||||
if (enable && this.isDisabled(plugin)){
|
||||
this.disabled.splice(this.disabled.indexOf(plugin.id), 1);
|
||||
plugin.obj.enabled();
|
||||
this.runWhenReady(plugin);
|
||||
if (reloading){
|
||||
location.reload();
|
||||
}
|
||||
else{
|
||||
this.disabled.splice(this.disabled.indexOf(plugin.id), 1);
|
||||
plugin.obj.enabled();
|
||||
this.runWhenReady(plugin);
|
||||
}
|
||||
}
|
||||
else if (!enable && !this.isDisabled(plugin)){
|
||||
this.disabled.push(plugin.id);
|
||||
plugin.obj.disabled();
|
||||
}
|
||||
else return;
|
||||
|
||||
if (plugin.obj.$pluginSettings.requiresPageReload){
|
||||
window.location.reload();
|
||||
if (reloading){
|
||||
location.reload();
|
||||
}
|
||||
else{
|
||||
this.disabled.push(plugin.id);
|
||||
plugin.obj.disabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user