Skip to content

Commit

Permalink
Merge pull request #13962 from kaalibro/dev
Browse files Browse the repository at this point in the history
Fixes generation restart not working for some users when 'Ctrl+Enter' is pressed
  • Loading branch information
AUTOMATIC1111 authored Nov 19, 2023
2 parents e4e875f + 94e9669 commit 5a031d9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,18 @@ document.addEventListener('keydown', function(e) {
if (isEnter && isModifierKey) {
if (interruptButton.style.display === 'block') {
interruptButton.click();
setTimeout(function() {
generateButton.click();
}, 500);
const callback = (mutationList) => {
for (const mutation of mutationList) {
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
if (interruptButton.style.display === 'none') {
generateButton.click();
observer.disconnect();
}
}
}
};
const observer = new MutationObserver(callback);
observer.observe(interruptButton, {attributes: true});
} else {
generateButton.click();
}
Expand Down

0 comments on commit 5a031d9

Please sign in to comment.