Change the way preferredUsername is synced

This commit is contained in:
Cédric Wagner 2023-04-07 15:58:38 +02:00
parent 1a14959594
commit a73e5a085e
2 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@
required
v-model="identity.name"
id="identityName"
@input="autoUpdateUsername"
@input="(event) => updateUsername(event.target.value)"
/>
</o-field>
@ -176,8 +176,8 @@ onBeforeMount(() => {
}
});
const autoUpdateUsername = () => {
identity.value.preferredUsername = convertToUsername(identity.value.name);
const updateUsername = (value: string) => {
identity.value.preferredUsername = convertToUsername(value);
};
const { onDone, onError, mutate } = registerAccount();

View File

@ -23,7 +23,7 @@
aria-required="true"
required
v-model="identity.name"
@input="autoUpdateUsername()"
@input="(event) => updateUsername(event.target.value)"
id="identity-display-name"
dir="auto"
/>
@ -759,7 +759,7 @@ const breadcrumbsLinks = computed(
}
);
const autoUpdateUsername = () => {
identity.value.preferredUsername = convertToUsername(identity.value.name);
const updateUsername = (value: string) => {
identity.value.preferredUsername = convertToUsername(value);
};
</script>