Rely on opts being pre-populated

This commit is contained in:
DepFA 2022-09-19 14:05:30 +01:00 committed by AUTOMATIC1111
parent 86021511af
commit bf1f3b8daf

View file

@ -102,14 +102,7 @@ onUiUpdate(function(){
fullImg_preview.forEach(galleryImageHandler);
}
if(Object.keys(opts).length != 0) return;
json_elem = gradioApp().getElementById('settings_json')
if(json_elem == null) return;
textarea = json_elem.querySelector('textarea')
jsdata = textarea.value
opts = JSON.parse(jsdata)
if(Object.keys(opts).length == 0) return;
if(!window.lightbox_settings_applied){
window.lightbox_settings_applied = true;