mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
Add missing isMac and isMobile flags to session service
This commit is contained in:
parent
53f7edf533
commit
881da18e8a
1 changed files with 7 additions and 0 deletions
|
@ -23,10 +23,17 @@ export default SimpleAuthSession.extend({
|
||||||
ajax: service(),
|
ajax: service(),
|
||||||
appMeta: service(),
|
appMeta: service(),
|
||||||
|
|
||||||
|
isMac: false,
|
||||||
|
isMobile: false,
|
||||||
authenticated: notEmpty('user.id'),
|
authenticated: notEmpty('user.id'),
|
||||||
isAdmin: oneWay('user.admin'),
|
isAdmin: oneWay('user.admin'),
|
||||||
isEditor: or('user.admin', 'user.editor'),
|
isEditor: or('user.admin', 'user.editor'),
|
||||||
|
|
||||||
|
init: function() {
|
||||||
|
this.set('isMac', is.mac());
|
||||||
|
this.set('isMobile', is.mobile());
|
||||||
|
},
|
||||||
|
|
||||||
user: computed('isAuthenticated', 'session.content.authenticated.user', function(){
|
user: computed('isAuthenticated', 'session.content.authenticated.user', function(){
|
||||||
if (this.get('isAuthenticated')) {
|
if (this.get('isAuthenticated')) {
|
||||||
let user = this.get('session.content.authenticated.user') || { id: '' };
|
let user = this.get('session.content.authenticated.user') || { id: '' };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue