fix: Add fallback to applySettingsButton var

Need due to layout change in recent webui update
269f6e8676
This commit is contained in:
MMaker
2023-01-03 00:07:15 -05:00
committed by GitHub
parent 89d36da47e
commit 2ba513bedc

View File

@@ -1059,7 +1059,10 @@ async function setup() {
let textAreas = getTextAreas();
// Add event listener to apply settings button so we can mirror the changes to our internal config
let applySettingsButton = gradioApp().querySelector("#tab_settings > div > .gr-button-primary");
let applySettingsButton = (
gradioApp().querySelector("#tab_settings > div > .gr-button-primary") ||
gradioApp().querySelector("#tab_settings > div > div > #settings_submit")
);
applySettingsButton.addEventListener("click", () => {
// Wait 500ms to make sure the settings have been applied to the webui opts object
setTimeout(async () => {
@@ -1158,4 +1161,4 @@ onUiUpdate(async () => {
await syncOptions();
// Rest of setup
setup();
});
});