Improve IdentityPicker

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-04-20 08:59:40 +02:00
parent 48f1d3efc6
commit eebcd48447
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -4,7 +4,7 @@
<p class="modal-card-title">{{ $t("Pick an identity") }}</p>
</header>
<section class="modal-card-body">
<div class="list is-hoverable">
<div class="list is-hoverable list-none">
<a
class="list-item"
v-for="identity in identities"
@ -12,7 +12,7 @@
:class="{
'is-active': currentIdentity && identity.id === currentIdentity.id,
}"
@click="changeCurrentIdentity(identity)"
@click="currentIdentity = identity"
>
<div class="media">
<img
@ -60,10 +60,11 @@ export default class IdentityPicker extends Vue {
identities: IActor[] = [];
currentIdentity: IActor = this.value;
get currentIdentity(): IActor {
return this.value;
}
changeCurrentIdentity(identity: IActor): void {
this.currentIdentity = identity;
set currentIdentity(identity: IActor) {
this.$emit("input", identity);
}
}