mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Merge pull request #13962 from kaalibro/dev
Fixes generation restart not working for some users when 'Ctrl+Enter' is pressed
This commit is contained in:
commit
5a031d9233
13
script.js
13
script.js
@ -133,9 +133,18 @@ document.addEventListener('keydown', function(e) {
|
||||
if (isEnter && isModifierKey) {
|
||||
if (interruptButton.style.display === 'block') {
|
||||
interruptButton.click();
|
||||
setTimeout(function() {
|
||||
const callback = (mutationList) => {
|
||||
for (const mutation of mutationList) {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
||||
if (interruptButton.style.display === 'none') {
|
||||
generateButton.click();
|
||||
}, 500);
|
||||
observer.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const observer = new MutationObserver(callback);
|
||||
observer.observe(interruptButton, {attributes: true});
|
||||
} else {
|
||||
generateButton.click();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user