Fixed issue with multiaccount selection

This commit is contained in:
RemixDev 2020-05-30 21:16:07 +02:00
parent c3749052d6
commit 6bc4997ff3
4 changed files with 6 additions and 9 deletions

View File

@ -576,8 +576,8 @@ <h2 v-else-if="type == 'album'">by <span class="clickable" @click="artistView"
<h2 class="page_heading">Settings</h2> <h2 class="page_heading">Settings</h2>
<div id="logged_in_info" ref="loggedInInfo"> <div id="logged_in_info" ref="loggedInInfo">
<img id="settings_picture" src="" alt="Profile Picture" class="circle" /> <img id="settings_picture" src="" alt="Profile Picture" ref="userpicture" class="circle" />
<p>You are logged in as <strong id="settings_username"></strong></p> <p>You are logged in as <strong id="settings_username" ref="username"></strong></p>
<button id="settings_btn_logout" @click="logout">Logout</button> <button id="settings_btn_logout" @click="logout">Logout</button>
<select v-if="accounts.length" id="family_account" v-model="accountNum" @change="changeAccount"> <select v-if="accounts.length" id="family_account" v-model="accountNum" @change="changeAccount">
<option v-for="(account, i) in accounts" :value="i.toString()">{{ account.BLOG_NAME }}</option> <option v-for="(account, i) in accounts" :value="i.toString()">{{ account.BLOG_NAME }}</option>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -76,11 +76,8 @@ const SettingsTab = new Vue({
socket.emit('changeAccount', this.accountNum) socket.emit('changeAccount', this.accountNum)
}, },
accountChanged(user, accountNum){ accountChanged(user, accountNum){
$('#settings_username').text(user.name) this.$refs.username.innerText = user.name
$('#settings_picture').attr( this.$refs.userpicture.src = `https://e-cdns-images.dzcdn.net/images/user/${user.picture}/125x125-000000-80-0-0.jpg`
'src',
`https://e-cdns-images.dzcdn.net/images/user/${user.picture}/125x125-000000-80-0-0.jpg`
)
this.accountNum = accountNum this.accountNum = accountNum
localStorage.setItem('accountNum', this.accountNum) localStorage.setItem('accountNum', this.accountNum)
}, },