Modify store user name when is modified in account config form
gitea/hedera-web/pipeline/pr-4922-vueMigration This commit looks good
Details
gitea/hedera-web/pipeline/pr-4922-vueMigration This commit looks good
Details
This commit is contained in:
parent
cdf534e70b
commit
bc97e000b8
|
@ -15,6 +15,7 @@ const { t } = useI18n();
|
||||||
const jApi = inject('jApi');
|
const jApi = inject('jApi');
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { isHeaderMounted } = storeToRefs(appStore);
|
const { isHeaderMounted } = storeToRefs(appStore);
|
||||||
|
const { user } = storeToRefs(userStore);
|
||||||
|
|
||||||
const vnFormRef = ref(null);
|
const vnFormRef = ref(null);
|
||||||
const vnFormRef2 = 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());
|
onMounted(() => fetchLanguagesSql());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -90,8 +100,8 @@ onMounted(() => fetchLanguagesSql());
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.nickname"
|
v-model="data.nickname"
|
||||||
:label="t('nickname')"
|
:label="t('nickname')"
|
||||||
@keyup.enter="vnFormRef.submit()"
|
@keyup.enter="updateUserNickname(data.nickname)"
|
||||||
@blur="vnFormRef.submit()"
|
@blur="updateUserNickname(data.nickname)"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.lang"
|
v-model="data.lang"
|
||||||
|
|
Loading…
Reference in New Issue