feat: implemented untested changeAccount fetching
This commit is contained in:
parent
87b0ff424b
commit
a2f808fe93
File diff suppressed because one or more lines are too long
@ -898,7 +898,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
socket.on('updateSettings', this.updateSettings)
|
socket.on('updateSettings', this.updateSettings)
|
||||||
socket.on('accountChanged', this.accountChanged)
|
// socket.on('accountChanged', this.accountChanged)
|
||||||
socket.on('familyAccounts', this.initAccounts)
|
socket.on('familyAccounts', this.initAccounts)
|
||||||
if (this.clientMode) {
|
if (this.clientMode) {
|
||||||
window.api.receive('downloadFolderSelected', this.downloadFolderSelected)
|
window.api.receive('downloadFolderSelected', this.downloadFolderSelected)
|
||||||
@ -907,7 +907,7 @@ export default {
|
|||||||
|
|
||||||
this.$on('hook:destroyed', () => {
|
this.$on('hook:destroyed', () => {
|
||||||
socket.off('updateSettings')
|
socket.off('updateSettings')
|
||||||
socket.off('accountChanged')
|
// socket.off('accountChanged')
|
||||||
socket.off('familyAccounts')
|
socket.off('familyAccounts')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -1038,8 +1038,11 @@ export default {
|
|||||||
appLogin() {
|
appLogin() {
|
||||||
window.api.send('applogin')
|
window.api.send('applogin')
|
||||||
},
|
},
|
||||||
changeAccount() {
|
async changeAccount() {
|
||||||
socket.emit('changeAccount', this.accountNum)
|
// socket.emit('changeAccount', this.accountNum)
|
||||||
|
const [user, accountNum] = await fetchData('changeAccount', this.accountNum)
|
||||||
|
|
||||||
|
this.accountChanged(user, accountNum)
|
||||||
},
|
},
|
||||||
accountChanged(user, accountNum) {
|
accountChanged(user, accountNum) {
|
||||||
this.$refs.username.innerText = user.name
|
this.$refs.username.innerText = user.name
|
||||||
|
Loading…
Reference in New Issue
Block a user