Skip to content

Commit

Permalink
Fixed console error on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
alex9849 committed Feb 25, 2021
1 parent 8951354 commit bf796c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<q-list>
<q-expansion-item
v-for="(section, index) in sidebarItems"
v-if="section.reqLevel <= getUser.adminLevel"
v-if="section.reqLevel <= getAdminLevel"
:label="section.label"
:icon="section.icon"
:key="index"
Expand All @@ -32,7 +32,7 @@
>
<q-item
v-for="(subsecion, subindex) in section.subSections"
v-if="subsecion.reqLevel <= getUser.adminLevel"
v-if="subsecion.reqLevel <= getAdminLevel"
style="padding-top: 5px; padding-bottom: 5px; min-height: 30px;"
active-class="bg-orange-2 text-dark"
:inset-level="0.4"
Expand Down Expand Up @@ -209,7 +209,8 @@ export default {
},
computed: {
...mapGetters({
getUser: 'auth/getUser'
getUser: 'auth/getUser',
getAdminLevel: 'auth/getAdminLevel'
}),
desktopMode() {
return this.windowWidth > this.desktopModeBreakPoint;
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/store/modules/auth/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export const getFormattedServerAddress = state => {
}
return address;
};
export const getAdminLevel = state => {
if(!getUser(state))
return 0;
return state.status.user.adminLevel;
};

export const isRecipeCreator = state => {
if(!getUser(state))
return false;
Expand Down

0 comments on commit bf796c4

Please sign in to comment.