diff --git a/frontend/src/App.vue b/frontend/src/App.vue index a6fc2a5..b304fba 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -100,6 +100,7 @@ export default { setUsername(e){ if (this.username.trim().length > 0){ this.didSetUsername = true + localStorage.setItem('username', this.username) this.$socket.emit('set_username', this.username) e.preventDefault(); } @@ -124,7 +125,11 @@ export default { init() { location.reload(); }, - } + }, + mounted() { + if (localStorage.getItem('username')) + this.username = localStorage.getItem('username') + }, }