Say "Hi" to my members.

Hello,
Sorry for publish a message in the forum.

I would like to make a Title in my wixsite that say “Hi, {Name}” without have to use the member menu.
I’ve tried this :

// Référence API : https://www.wix.com/velo/reference/api-overview/introduction
// Exemple de code « Hello World » : https://learn-code.wix.com/en/article/1-hello-world

import wixUsers from 'wix-users';
import wixData from 'wix-data';
import { authentication } from 'wix-members'

$w.onReady(function () {
    if (onLogin) {
    wixData.query("Members/PrivateMembersData")
        .eq("_id", wixUsers.currentUser.id)
        .find()
        .then((results) => {
           //This changes the text to for example Hi Sivan:
           $w("#hi").text = "Hi " + results.items[0].firstName;
           //Put any script using the variable here
        })
}
});

But nothing is working.
I would be really glad if somebody could help me to find a solution for this really simple thing that block me for few hours now.
Thanks

The if(onLogin) is wrong, it should be if(wixUsers.currentUser.loggedIn)
Also if you use .get instead of query it should be a little bit faster,