I’m using a short script to call and display the users name, but it works very slowly, sometimes taking 10+ seconds to actually show the correct details.
Can I do anything to speed this process up?
import wixUsers from 'wix-users';
import wixData from 'wix-data';
$w.onReady(function () {
const user = wixUsers.currentUser;
const userId = user.id;
const loggedIn = user.loggedIn;
if (loggedIn) {
wixData.query("Members/PrivateMembersData")
.eq("_id", userId)
.find()
.then((results) => {
$w("#userName").text = results.items[0].firstName;
})
}
});