mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 17:17:32 +00:00
Fix "Edit profile" on the account action bar (#3222)
This commit is contained in:
parent
aa662cecad
commit
07af8c05fd
|
@ -33,11 +33,14 @@ class DropdownMenu extends React.PureComponent {
|
||||||
const i = Number(e.currentTarget.getAttribute('data-index'));
|
const i = Number(e.currentTarget.getAttribute('data-index'));
|
||||||
const { action, to } = this.props.items[i];
|
const { action, to } = this.props.items[i];
|
||||||
|
|
||||||
e.preventDefault();
|
// Don't call e.preventDefault() when the item uses 'href' property.
|
||||||
|
// ex. "Edit profile" on the account action bar
|
||||||
|
|
||||||
if (typeof action === 'function') {
|
if (typeof action === 'function') {
|
||||||
|
e.preventDefault();
|
||||||
action();
|
action();
|
||||||
} else if (to) {
|
} else if (to) {
|
||||||
|
e.preventDefault();
|
||||||
this.context.router.push(to);
|
this.context.router.push(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue