improve user menu

This commit is contained in:
Thomas Amland
2020-07-31 18:39:29 +02:00
parent b82172adf6
commit 6ad7d8d33d
4 changed files with 32 additions and 6 deletions
+2
View File
@@ -19,6 +19,7 @@
BIconThreeDotsVertical,
BIconMusicNoteBeamed,
BIconBoxArrowRight,
BIconPersonFill,
} from 'bootstrap-vue'
export default Vue.extend({
@@ -38,6 +39,7 @@
BIconThreeDotsVertical,
BIconMusicNoteBeamed,
BIconBoxArrowRight,
BIconPersonFill,
},
props: {
icon: { type: String }
+4 -1
View File
@@ -9,6 +9,7 @@ import { API } from './api';
interface State {
isLoggedIn: boolean;
username: null | string;
server: null | string;
showMenu: boolean;
error: Error | null;
playlists: any[];
@@ -18,6 +19,7 @@ const setupRootModule = (authService: AuthService, api: API): Module<State, any>
state: {
isLoggedIn: false,
username: null,
server: null,
showMenu: false,
error: null,
playlists: [],
@@ -29,9 +31,10 @@ const setupRootModule = (authService: AuthService, api: API): Module<State, any>
clearError(state) {
state.error = null;
},
setLoginSuccess(state, { username }) {
setLoginSuccess(state, { username, server }) {
state.isLoggedIn = true;
state.username = username;
state.server = server;
},
toggleMenu(state) {
state.showMenu = !state.showMenu;