i try this code in header
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
let userTrustLevel = parseInt(Discourse.User.current().trust_level);
if (userTrustLevel < 4) {
document.querySelectorAll(".pin-topic, .unpin-topic").forEach(button => {
button.style.pointerEvents = "none";
button.style.opacity = "0.5";
button.title = "You don't have permission to pin topics";
});
}
}, 1000); complet
});
and in css
.d-header-icons .pin-topic,
.d-header-icons .unpin-topic,
.controls .pin-topic,
.controls .unpin-topic {
display: none !important;
}
but simple user with trust 1 or 0 can tap to pin button and can see it.
Automatically unpin topics when the user reaches the bottom by default.
this is off
Automatically unpin topics when the user reaches the bottom.
this is off