mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
defer navigation display until user promise is fulfilled
This commit is contained in:
parent
7e14378a63
commit
a75f6f8579
1 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue