Problem with repeaters

Hi!

I´ve just published my site viennapiano.club and it seems to have a problem with repeaters. Everything is correctly connected and usually it works, but sometimes it happens, that the repeater would show the preset instead of the data. I enabled caching, which makes it better, but still, if you delete all cookies you have the same problem again and gives a bad first impression. If you reload the site a second time it works though.

Im my opinion the problem is that the data is not loaded on time, so I´ve tried to fix it with this code (I´m quite new to coding I have to say):

import wixData from ‘wix-data’ ;

$w.onReady( function () {
wixData.query( “dataset1” )
.find()
.then( (results) => {
$w( “#repeater1” ).show()
} );
} );

I´ve also tried it with “onReady” but the problem remains. Any suggestions? The problem appears only on mobile devices.

$w . onReady (() => {
$w ( ‘#dataset1’ ). onReady (() => {
$w ( ‘#repeater1’ ).show()
})
})

What do you mean by “t he repeater would show the preset instead of the data”?

It shows the repeater without the data. When you reload it, it shows the data. This is a screenshot from a user sent to me.

Check the collection permissions first.

that shouldn´t be the problem, it´s visible for everyone. And most of the time it works, only when the internet connection is a bit slow or on mobile devices that happens sometimes. But it looks quite unprofessional when it happens and I wonder if there´s a way to change it

Your code is wrong.
It’s a mix of dataset and direct query that doesn’t do any good.

Anyway, make the repeater hidden on load and show only after data binding

How would you do that? I´ve been trying with this code as well but I don´t know how to do it better:

import wixData from ‘wix-data’ ;

$w.onReady(() => {
$w( ‘#dataset1’ ).onReady(() => {
$w( ‘#repeater1’ ).show()
})
});