Skip to content

Commit

Permalink
fix edit polls
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Feb 21, 2024
1 parent cbc5011 commit 6a9d97f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 1 addition & 3 deletions js/src/forum/components/ComposePollHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export default class ComposePollHero extends Component<ComposePollHeroAttrs> {
icon="far fa-arrow-up-right-from-square"
className="Button Button--secondary IndexPage-newDiscussion GoodiePreviewLink"
itemClassName="App-primaryControl"
href={app.route('fof.polls.list', { id: poll.id() })}
external={true}
target="_blank"
href={app.route('fof.polls.view', { id: poll.id() })}
>
{app.translator.trans('fof-polls.forum.compose.polls_preview')}
</LinkButton>
Expand Down
8 changes: 1 addition & 7 deletions js/src/forum/utils/PollControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import PollsPage from '../components/PollsPage';
import ItemList from 'flarum/common/utils/ItemList';
import Separator from 'flarum/common/components/Separator';
import Button from 'flarum/common/components/Button';
import Link from 'flarum/common/components/Link';

/**
* The `UserControls` utility constructs a list of buttons for a user which
Expand Down Expand Up @@ -37,11 +36,6 @@ export default {
pollControls(poll: Poll, context: Component): ItemList<Mithril.Children> {
const items = new ItemList<Mithril.Children>();

items.add(
'view',
<Link href={app.route('fof.polls.view', { id: poll.id() })}>{app.translator.trans('fof-polls.forum.poll_controls.view_label')}</Link>
);

return items;
},

Expand Down Expand Up @@ -119,6 +113,6 @@ export default {
* Edit the poll.
*/
editAction(poll: Poll): void {
m.route.set(app.route('fof_polls_compose', { id: poll.id() }));
m.route.set(app.route('fof.polls.compose', { id: poll.id() }));
},
};

0 comments on commit 6a9d97f

Please sign in to comment.