Skip to content

Commit

Permalink
Fix selectedHook saving
Browse files Browse the repository at this point in the history
  • Loading branch information
derekantrican committed May 14, 2023
1 parent 666a17d commit c75f33a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion octoprint_webhooks/static/js/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ $(function() {
}
}

self.onSettingsShown = function () {
// Once the settings are saved, the selectedHook will no longer be the same as
// settings.settings.plugins.webhooks.hooks()[self.selectedIndex()] (because
// new observables are created with the new settings values). So before the
// settings window is shown, we'll re-assign the selectedHook
self.selectHook(self.selectedIndex());

//Todo: is this what was intended by some of the code in onBeforeBinding? Should investigate
}

self.templateChanged = function(data) {
self.templateActivated(false)
self.templateDescription(self.template()["_description"])
Expand Down Expand Up @@ -232,7 +242,7 @@ $(function() {
console.log('PLUGS - Ignoring '+plugin);
return;
}

hide = true
if (data["hide"] !== undefined) {
hide = data["hide"]
Expand Down

0 comments on commit c75f33a

Please sign in to comment.