Force Server Connect to finish before loading image

I have a profile image which has a dynamic src from my server connect sc_user_get. The image shows up fine, but I’m getting an error https://res.cloudinary.com/tripmakers/image/upload/w_150,c_fill,ar_1:1,g_auto,r_max,b_rgb:1d1919/d_no_image.jpg/Tripmakers/Users/.jpg 400

So it seems like the image is trying to load prior to the server connect finishing. Is there a way to override this? It’s not a huge deal, but I’m trying to get to zero errors, and this is the last one remaining so it’s just a bit annoying.

Hi @Heather_Mann, this might be what you are looking for.

It’s not showing an error on the page, just in the developers console. But that preloader is cool so thanks.

Hi,

You could use a ternary operator for binding. but use cautiously as it may make your page slower if used a lot.

<img dmx-bind:src="sc1.data.imagepath ? sc1.data.imagepath : ''>

OR

<img dmx-bind:src="sc1.data.imagepath ? sc1.data.imagepath : 'noimage.png'>