Skip to content

Commit

Permalink
Don't update gcode scripts if gcode script obvservables are still und…
Browse files Browse the repository at this point in the history
…efined. This occurs when settings hasn't been in opened such as the wizard.
  • Loading branch information
kantlivelong committed Feb 1, 2021
1 parent 89a27b8 commit d2e2a74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions octoprint_smartpreheat/static/js/smartpreheat.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ $(function() {
};

self.onSettingsBeforeSave = function () {
if (self.scripts_gcode_snippets_doSmartPreheat() != self.settings.scripts.gcode["snippets/doSmartPreheat"]()) {
self.settings.plugins.smartpreheat.scripts_gcode_snippets_doSmartPreheat = self.scripts_gcode_snippets_doSmartPreheat;
self.settings.scripts.gcode["snippets/doSmartPreheat"](self.scripts_gcode_snippets_doSmartPreheat());
if (self.scripts_gcode_snippets_doSmartPreheat() !== undefined) {
if (self.scripts_gcode_snippets_doSmartPreheat() != self.settings.scripts.gcode["snippets/doSmartPreheat"]()) {
self.settings.plugins.smartpreheat.scripts_gcode_snippets_doSmartPreheat = self.scripts_gcode_snippets_doSmartPreheat;
self.settings.scripts.gcode["snippets/doSmartPreheat"](self.scripts_gcode_snippets_doSmartPreheat());
}
}
};
}
Expand Down

0 comments on commit d2e2a74

Please sign in to comment.