Fix app init

This commit is contained in:
Cohee 2024-05-19 11:52:49 +03:00
parent 9637b3fbe1
commit 581e5f1f04

View File

@ -194,7 +194,7 @@ async function showSamplerSelectPopup() {
function setSamplerListListeners() { function setSamplerListListeners() {
// Goal 2: hide unchecked samplers from DOM // Goal 2: hide unchecked samplers from DOM
let listContainer = $('#apiSamplersList') let listContainer = $('#apiSamplersList');
listContainer.find('input').off('change').on('change', async function () { listContainer.find('input').off('change').on('change', async function () {
const samplerName = this.name.replace('_checkbox', ''); const samplerName = this.name.replace('_checkbox', '');
@ -353,6 +353,9 @@ async function listSamplers(main_api, arrayOnly = false) {
export async function validateDisabledSamplers(redraw = false) { export async function validateDisabledSamplers(redraw = false) {
const APISamplers = await listSamplers(main_api, true); const APISamplers = await listSamplers(main_api, true);
if (!Array.isArray(APISamplers)) {
return;
}
for (const sampler of APISamplers) { for (const sampler of APISamplers) {
let relatedDOMElement = $(`#${sampler}_${main_api}`).parent(); let relatedDOMElement = $(`#${sampler}_${main_api}`).parent();