From 03e95a2c69cdd3d1bddc9a11292532f538ef2950 Mon Sep 17 00:00:00 2001 From: Sam Hoffman Date: Tue, 13 Jan 2026 00:34:45 -0500 Subject: [PATCH] allow changing nicks. store nick/avatar in localStorage --- irchad-web/src/components/UserCard.vue | 8 +++---- irchad-web/src/stores/irc.js | 31 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/irchad-web/src/components/UserCard.vue b/irchad-web/src/components/UserCard.vue index b4badb7..6d8c623 100644 --- a/irchad-web/src/components/UserCard.vue +++ b/irchad-web/src/components/UserCard.vue @@ -4,11 +4,12 @@ import { useIRCStore } from "@/stores/irc"; import { storeToRefs } from "pinia"; const { selfAvatar } = storeToRefs(useIRCStore()); -const { client, clientInfo, setAvatar, setNick } = useIRCStore(); +const { clientInfo, setAvatar, setNick } = useIRCStore(); const avatarDialog = ref(false); const newNick = ref(); function changeAvatar() { + newNick.value = clientInfo.nick; avatarDialog.value = true; } @@ -16,14 +17,13 @@ function submitAvatar() { setAvatar(selfAvatar.value); avatarDialog.value = false; if (newNick.value && clientInfo.nick !== newNick.value) { - console.log("nick changed"); - client.changeNick(newNick.value); + setNick(newNick.value); } }