Modify store user name when is modified in account config form
gitea/hedera-web/pipeline/pr-4922-vueMigration This commit looks good Details

This commit is contained in:
William Buezas 2024-09-16 14:41:44 -03:00
parent cdf534e70b
commit bc97e000b8
1 changed files with 12 additions and 2 deletions

View File

@ -15,6 +15,7 @@ const { t } = useI18n();
const jApi = inject('jApi');
const appStore = useAppStore();
const { isHeaderMounted } = storeToRefs(appStore);
const { user } = storeToRefs(userStore);
const vnFormRef = ref(null);
const vnFormRef2 = ref(null);
@ -43,6 +44,15 @@ const fetchLanguagesSql = async () => {
}
};
const updateUserNickname = async nickname => {
try {
await vnFormRef.value.submit();
user.value.nickname = nickname;
} catch (error) {
console.error(error);
}
};
onMounted(() => fetchLanguagesSql());
</script>
@ -90,8 +100,8 @@ onMounted(() => fetchLanguagesSql());
<VnInput
v-model="data.nickname"
:label="t('nickname')"
@keyup.enter="vnFormRef.submit()"
@blur="vnFormRef.submit()"
@keyup.enter="updateUserNickname(data.nickname)"
@blur="updateUserNickname(data.nickname)"
/>
<VnSelect
v-model="data.lang"