import ModalService from '~/services/modal.service'; async function validate() { console.log('==> VALIDATE'); const modalservice = await ModalService.getInstance(); modalservice.closeValidationModal(); } export async function initValidationModal(processDiffs: any) { console.log("🚀 ~ initValidationModal ~ processDiffs:", processDiffs) for(const diff of processDiffs.diffs) { let diffs = '' for(const value of diff) { diffs+= `
-${value.previous_value}
+${value.new_value}
` } const state = `
State ${diff[0].new_state_merkle_root}
${diffs}
` const box = document.querySelector('.validation-box') if(box) box.innerHTML += state } document.querySelectorAll('.expansion-panel-header').forEach((header) => { header.addEventListener('click', function (event) { const target = event.target as HTMLElement; const body = target.nextElementSibling as HTMLElement; if (body?.style) body.style.display = body.style.display === 'block' ? 'none' : 'block'; }); }); } (window as any).validate = validate;