Hello everyone!
I have a Dynamic collection of freelancers, each item is a Profile. The information has been collected through the Memberstack and passed to Webflow, so emails are all matching.
Profiles are public and can be seen by anyone, but I want to add an “Update profile” section to the page and I want it to be available ONLY if the logged user opens its own profile page
I tried using this snippet but for some reason, it always goes to the option else
MemberStack.onReady.then(function(member) {
var profileEmail = document.getElementById("profile-email");
var updateButton = document.getElementById("update-button");
// check if member is logged in
if (member.loggedIn) {
if (profileEmail.innerHTML === member.email) {
updateButton.style.display = "inline-block";
} else {
updateButton.style.display = "none";
}
}
})
I have a workaround that kinda solves it for now, but it feels like there should be a better solution. Can’t figure out why it’s not working as I expected