Skip to content

Commit 5935cce

Browse files
committed
check perm
1 parent 67e5561 commit 5935cce

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/webpage/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,15 @@ if (window.location.pathname.startsWith("/channels")) {
424424
e.stopImmediatePropagation();
425425
};
426426
const umenu = new Contextmenu<void, void>("upload");
427-
umenu.addButton(I18n.makePoll(), () => {
428-
thisUser.makePoll();
429-
});
427+
umenu.addButton(
428+
I18n.makePoll(),
429+
() => {
430+
thisUser.makePoll();
431+
},
432+
{
433+
visible: () => !!thisUser.channelfocus?.hasPermission("SEND_POLLS"),
434+
},
435+
);
430436
umenu.addButton(I18n.upload(), () => {
431437
const input = document.createElement("input");
432438
input.type = "file";

0 commit comments

Comments
 (0)