mirror of
https://github.com/flarum/core.git
synced 2025-08-05 16:07:34 +02:00
Finish signup process, including state restoration
This commit is contained in:
@@ -7,6 +7,13 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||
activate: function() {
|
||||
if (!Ember.isEmpty(FLARUM_ALERT)) {
|
||||
this.controllerFor('alerts').send('alert', AlertMessage.create(FLARUM_ALERT));
|
||||
FLARUM_ALERT = null;
|
||||
}
|
||||
|
||||
var restoreUrl = localStorage.getItem('restoreUrl');
|
||||
if (restoreUrl && this.get('session.isAuthenticated')) {
|
||||
this.transitionTo(restoreUrl);
|
||||
localStorage.removeItem('restoreUrl');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -42,6 +49,10 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||
|
||||
sessionChanged: function() {
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
saveState: function() {
|
||||
localStorage.setItem('restoreUrl', this.router.get('url'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user