update
All checks were successful
Deploy / deploy (push) Successful in 43s

This commit is contained in:
Никита Круглицкий 2025-10-09 06:23:13 +06:00
parent e2064dba6c
commit 6ada2c3fbd
2 changed files with 9 additions and 6 deletions

View File

@ -8,7 +8,7 @@
<label for="username">Username</label> <label for="username">Username</label>
</PrimeFloatLabel> </PrimeFloatLabel>
<PrimeButton label="Save" type="submit" /> <PrimeButton label="Save" type="submit" :disabled="!localUsername || localUsername === username" />
</form> </form>
</div> </div>
</template> </template>
@ -25,11 +25,14 @@ const toast = useToast()
const localUsername = ref(username.value) const localUsername = ref(username.value)
async function save() { async function save() {
if (localUsername.value && localUsername.value !== username.value) { if (!localUsername.value || localUsername.value === username.value)
return
username.value = localUsername.value username.value = localUsername.value
await signaling.socket.value?.emitWithAck('updateClient', { username }) await signaling.socket.value?.emitWithAck('updateClient', {
} username: username.value,
})
toast.add({ severity: 'success', summary: 'Saved', life: 1000, closable: false }) toast.add({ severity: 'success', summary: 'Saved', life: 1000, closable: false })
} }

View File

@ -432,7 +432,7 @@ export default function (io: SocketServer, router: types.Router) {
cb({ ok: true }) cb({ ok: true })
socket.broadcast.emit('clientChanged', socket.id, socketToClient(socket)) namespace.emit('clientChanged', socket.id, socketToClient(socket))
}) })
socket.on('disconnect', () => { socket.on('disconnect', () => {