problem with logic


I have a sessionToken in localstorage named "session".
How do I show that the sessionToken localstorage is called "session" and do my images appear?

The other problem I have is that I want when the image field in the database is empty, the image disappears.
Can you help me?
That JS code I can use to make the image disappear?
But if the field in the database is populated with a file, I want to show the image.

var sessionToken = localStorage.getItem("session");
if(!value ||!value.fileName){
element.hide("mobileimage_26");
return "";
}
return "https://api.appery.io/rest/1/db/files..." + value.fileName + "?sessionToken="+ sessionToken;

The code I used was this, but it does not work.
I would like to help me rewrite it another way to see if it works.
There are errors in the browser console, ja depudei the app and there are no errors.
I believe that the logic of this code is written in the wrong way.

Can you help me rewrite it in another way?
1 person has
this problem
+1
This topic is no longer open for comments or replies.