mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-30 15:29:33 +05:30
#138: fix a bug with hash applied to url after clicking on link on rules page
This commit is contained in:
parent
95e7c0ae87
commit
d2ca6b23c7
@ -25,7 +25,7 @@ const rules = [
|
||||
<Message {...messages.mainProvision2} />,
|
||||
<Message {...messages.mainProvision3} />,
|
||||
<Message {...messages.mainProvision4} values={{
|
||||
link: (<Link to={'/register'}>https://account.ely.by/register</Link>)
|
||||
link: (<Link to="/register">https://account.ely.by/register</Link>)
|
||||
}} />
|
||||
]
|
||||
},
|
||||
@ -130,6 +130,11 @@ export default class RulesPage extends Component {
|
||||
}
|
||||
|
||||
onRuleClick(event) {
|
||||
if (event.defaultPrevented || event.target.tagName.toLowerCase() === 'a') {
|
||||
// some-one have already processed this event or it is a link
|
||||
return;
|
||||
}
|
||||
|
||||
const {id} = event.currentTarget;
|
||||
const {router} = this.context;
|
||||
const newLocation = router.createLocation({...location, hash: `#${id}`});
|
||||
|
@ -6,10 +6,10 @@ export default class RegisterState extends AbstractState {
|
||||
enter(context) {
|
||||
const {user} = context.getState();
|
||||
|
||||
if (!user.isGuest) {
|
||||
context.setState(new CompleteState());
|
||||
} else {
|
||||
if (user.isGuest) {
|
||||
context.navigate('/register');
|
||||
} else {
|
||||
context.setState(new CompleteState());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user