1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-20 12:15:51 +02:00

Fix errors in edit-design plugin when disabling/enabling

This commit is contained in:
chylex 2017-06-05 14:43:14 +02:00
parent a753806d7b
commit ca4d374a81

View File

@ -58,9 +58,13 @@ enabled(){
this.firstTimeLoad = obj === null;
this.onStageReady();
this.injectDeciderReplyHook(this.tmpConfig.revertReplies);
this.injectDeciderReplyHook(obj && obj.revertReplies);
};
if (this.wasLoadedBefore){
this.onStageReady();
}
else{
$(document).one("dataSettingsValues", () => {
switch(TD.settings.getColumnWidth()){
case "wide": this.defaultConfig.columnWidth = "350px"; break;
@ -74,8 +78,10 @@ enabled(){
case "largest": this.defaultConfig.fontSize = "16px"; break;
}
this.wasLoadedBefore = true;
this.onStageReady();
});
}
$TDP.checkFileExists(this.$token, configFile).then(exists => {
if (!exists){
@ -306,13 +312,13 @@ enabled(){
};
this.onWindowFocusEvent = () => {
if (this.config.optimizeAnimations){
if (this.config && this.config.optimizeAnimations){
injectOptimizations(true);
}
};
this.onWindowBlurEvent = () => {
if (this.config.optimizeAnimations){
if (this.config && this.config.optimizeAnimations){
disableOptimizations();
clearOptimizationTimer();
}