11import { PageNames } from '../constants' ;
22import * as coreActions from 'kolibri.coreVue.vuex.actions' ;
3- import * as coreGetters from 'kolibri.coreVue.vuex.getters' ;
3+ import { isUserLoggedIn , isSuperuser } from 'kolibri.coreVue.vuex.getters' ;
44import router from 'kolibri.coreVue.router' ;
55import {
66 SignUpResource ,
@@ -14,7 +14,7 @@ function redirectToHome() {
1414}
1515
1616function showRoot ( store ) {
17- const userSignedIn = coreGetters . isUserLoggedIn ( store . state ) ;
17+ const userSignedIn = isUserLoggedIn ( store . state ) ;
1818 if ( userSignedIn ) {
1919 router . getInstance ( ) . replace ( {
2020 name : PageNames . PROFILE ,
@@ -30,7 +30,7 @@ function editProfile(store, edits, session) {
3030 // payload needs username, fullname, and facility
3131 // used to save changes to API
3232 function getUserModel ( ) {
33- if ( coreGetters . isAdmin ( store . state ) ) {
33+ if ( isSuperuser ( store . state ) ) {
3434 return DeviceOwnerResource . getModel ( session . user_id ) ;
3535 }
3636 return FacilityUserResource . getModel ( session . user_id ) ;
@@ -98,7 +98,7 @@ function resetProfileState(store) {
9898}
9999
100100function showProfile ( store ) {
101- const userSignedIn = coreGetters . isUserLoggedIn ( store . state ) ;
101+ const userSignedIn = isUserLoggedIn ( store . state ) ;
102102 if ( ! userSignedIn ) {
103103 router . getInstance ( ) . replace ( {
104104 name : PageNames . SIGN_IN ,
@@ -113,7 +113,7 @@ function showProfile(store) {
113113}
114114
115115function showSignIn ( store ) {
116- const userSignedIn = coreGetters . isUserLoggedIn ( store . state ) ;
116+ const userSignedIn = isUserLoggedIn ( store . state ) ;
117117 if ( userSignedIn ) {
118118 router . getInstance ( ) . replace ( {
119119 name : PageNames . PROFILE ,
@@ -138,7 +138,7 @@ function resetSignUpState(store) {
138138}
139139
140140function showSignUp ( store ) {
141- const userSignedIn = coreGetters . isUserLoggedIn ( store . state ) ;
141+ const userSignedIn = isUserLoggedIn ( store . state ) ;
142142 if ( userSignedIn ) {
143143 router . getInstance ( ) . replace ( {
144144 name : PageNames . PROFILE ,
0 commit comments