mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
defer navigation display until user promise is fulfilled
This commit is contained in:
parent
7e14378a63
commit
a75f6f8579
@ -6,7 +6,13 @@ export default Controller.extend({
|
|||||||
dropdown: injectService(),
|
dropdown: injectService(),
|
||||||
session: injectService(),
|
session: injectService(),
|
||||||
|
|
||||||
showNavMenu: computed('currentPath', 'session.isAuthenticated', function () {
|
showNavMenu: computed('currentPath', 'session.isAuthenticated', 'session.user.isFulfilled', function () {
|
||||||
|
// we need to defer showing the navigation menu until the session.user
|
||||||
|
// promise has fulfilled so that gh-user-can-admin has the correct data
|
||||||
|
if (!this.get('session.isAuthenticated') || !this.get('session.user.isFulfilled')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return (this.get('currentPath') !== 'error404' || this.get('session.isAuthenticated'))
|
return (this.get('currentPath') !== 'error404' || this.get('session.isAuthenticated'))
|
||||||
&& !this.get('currentPath').match(/(signin|signup|setup|reset)/);
|
&& !this.get('currentPath').match(/(signin|signup|setup|reset)/);
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user