Not showing a text until it is updated

First of all, thank you all for the help you provide in this forum. Up until now, I have been able to solve all my problems through this forum. However, I am stuck with the following issue.

I have a hidden text until an input is received. Once this input is received, it checks in a database whether an online inscription is possible or not. If it is possible, it shows the button to continue with the inscription. If it is not, it shows a personalised message from the database.

The following code works fine! However, although I first update the text and then show it, when I preview it it first shows the previous text, waits like 0.5 seconds and then updates, which is kind of annoying. I want it to show it already updated.

I thought of adding a delay of like 1 second, but I was wondering if there was a fancier way to achieve this.

export function pInputCentreEducatiu_change(event) {
wixData.query(‘codisCentre’)
.eq(‘title’, $w(‘#pInputCentreEducatiu’).value)
.find()
.then((results) => {
let item = results.items[0];
if (item.matriculaOnline) {
$w(‘#pInputCodiCentre’).show(“fade”);
$w(‘#p0BotoSeguent’).show(“fade”);
$w(‘#pTextNoMatriculaOnline’).hide();
$w(‘#box9’).hide();
} else {
$w(‘#pTextNoMatriculaOnline’).text = item.alternativaMatricula;
$w(‘#pTextNoMatriculaOnline’).show(“fade”);
$w(‘#box9’).show(“fade”);
$w(‘#pInputCodiCentre’).hide();
$w(‘#p0BotoSeguent’).hide();
}
})
}

Thank you all for your help!