Merge pull request #1435 from LenAnderson/fix-popup-closing-next-popup

fix old popup closing next popup
This commit is contained in:
Cohee 2023-12-03 00:37:41 +02:00 committed by GitHub
commit df05d55a73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,6 +381,7 @@ let rawPromptPopper = Popper.createPopper(document.getElementById('dialogue_popu
}); });
let dialogueResolve = null; let dialogueResolve = null;
let dialogueCloseStop = false;
let chat_metadata = {}; let chat_metadata = {};
let streamingProcessor = null; let streamingProcessor = null;
let crop_data = undefined; let crop_data = undefined;
@ -6261,6 +6262,7 @@ function onScenarioOverrideRemoveClick() {
} }
function callPopup(text, type, inputValue = '', { okButton, rows, wide, large } = {}) { function callPopup(text, type, inputValue = '', { okButton, rows, wide, large } = {}) {
dialogueCloseStop = true;
if (type) { if (type) {
popup_type = type; popup_type = type;
} }
@ -7823,12 +7825,14 @@ jQuery(async function () {
}); });
$('#dialogue_popup_ok').click(async function (e) { $('#dialogue_popup_ok').click(async function (e) {
dialogueCloseStop = false;
$('#shadow_popup').transition({ $('#shadow_popup').transition({
opacity: 0, opacity: 0,
duration: 200, duration: 200,
easing: animation_easing, easing: animation_easing,
}); });
setTimeout(function () { setTimeout(function () {
if (dialogueCloseStop) return;
$('#shadow_popup').css('display', 'none'); $('#shadow_popup').css('display', 'none');
$('#dialogue_popup').removeClass('large_dialogue_popup'); $('#dialogue_popup').removeClass('large_dialogue_popup');
$('#dialogue_popup').removeClass('wide_dialogue_popup'); $('#dialogue_popup').removeClass('wide_dialogue_popup');
@ -7916,12 +7920,14 @@ jQuery(async function () {
}); });
$('#dialogue_popup_cancel').click(function (e) { $('#dialogue_popup_cancel').click(function (e) {
dialogueCloseStop = false;
$('#shadow_popup').transition({ $('#shadow_popup').transition({
opacity: 0, opacity: 0,
duration: 200, duration: 200,
easing: animation_easing, easing: animation_easing,
}); });
setTimeout(function () { setTimeout(function () {
if (dialogueCloseStop) return;
$('#shadow_popup').css('display', 'none'); $('#shadow_popup').css('display', 'none');
$('#dialogue_popup').removeClass('large_dialogue_popup'); $('#dialogue_popup').removeClass('large_dialogue_popup');
}, 200); }, 200);