1
0
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:
Toby Zerner
2015-02-25 15:34:02 +10:30
parent 076be26001
commit 9ea482254c
15 changed files with 62 additions and 29 deletions

View File

@@ -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'));
}
}
});