mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-03-30 17:45:40 +00:00
fix perm checking
This commit is contained in:
@@ -1055,7 +1055,7 @@ class Channel extends SnowFlake {
|
||||
decdiv.appendChild(myhtml);
|
||||
caps.appendChild(decdiv);
|
||||
|
||||
if (admin) {
|
||||
if (this.guild.member.hasPermission("MANAGE_CHANNELS")) {
|
||||
const addchannel = document.createElement("span");
|
||||
addchannel.classList.add("addchannel", "svgicon", "svg-plus");
|
||||
caps.appendChild(addchannel);
|
||||
|
||||
@@ -114,7 +114,11 @@ if (window.location.pathname.startsWith("/channels")) {
|
||||
thisUser.lookingguild.createchannels();
|
||||
}
|
||||
},
|
||||
{visible: () => thisUser.isAdmin()},
|
||||
{
|
||||
visible: function () {
|
||||
return thisUser.channelfocus?.guild.member.hasPermission("MANAGE_CHANNELS") || false;
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
menu.addButton(
|
||||
@@ -124,10 +128,13 @@ if (window.location.pathname.startsWith("/channels")) {
|
||||
thisUser.lookingguild.createcategory();
|
||||
}
|
||||
},
|
||||
{visible: () => thisUser.isAdmin()},
|
||||
{
|
||||
visible: function () {
|
||||
return thisUser.channelfocus?.guild.member.hasPermission("MANAGE_CHANNELS") || false;
|
||||
},
|
||||
},
|
||||
);
|
||||
const channelw = document.getElementById("channelw");
|
||||
console.log(channelw);
|
||||
if (channelw)
|
||||
channelw.addEventListener("keypress", (e) => {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.metaKey) return;
|
||||
|
||||
Reference in New Issue
Block a user