Skip to content

Commit

Permalink
another one
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Oct 23, 2024
1 parent 768743c commit 8c0acf0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/src/forum/utils/PollControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export default {
controls(poll: Poll, context: Component): ItemList<Mithril.Children> {
const items = new ItemList<Mithril.Children>();

['poll', 'moderation', 'destructive'].forEach((section) => {
const controls = (this[section + 'Controls'](poll, context) as ItemList<Mithril.Children>).toArray();
const sections: ('poll' | 'moderation' | 'destructive')[] = ['poll', 'moderation', 'destructive'];
sections.forEach((section) => {
const controls = (this[`${section}Controls`](poll, context) as ItemList<Mithril.Children>).toArray();
if (controls.length) {
controls.forEach((item) => items.add(item.itemName, item));
items.add(section + 'Separator', <Separator />);
Expand Down

0 comments on commit 8c0acf0

Please sign in to comment.