From 5935ccedd33b2f1baab6fba07868a0da6acf14ec Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Thu, 21 May 2026 16:19:10 -0500 Subject: [PATCH] check perm --- src/webpage/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/webpage/index.ts b/src/webpage/index.ts index e2c438e..b9bf317 100644 --- a/src/webpage/index.ts +++ b/src/webpage/index.ts @@ -424,9 +424,15 @@ if (window.location.pathname.startsWith("/channels")) { e.stopImmediatePropagation(); }; const umenu = new Contextmenu("upload"); - umenu.addButton(I18n.makePoll(), () => { - thisUser.makePoll(); - }); + umenu.addButton( + I18n.makePoll(), + () => { + thisUser.makePoll(); + }, + { + visible: () => !!thisUser.channelfocus?.hasPermission("SEND_POLLS"), + }, + ); umenu.addButton(I18n.upload(), () => { const input = document.createElement("input"); input.type = "file";