Merge branch '1481-trying-to-contact-the-organizer-contact-crashes-the-app' into 'main'

trying to contact the organizer contact crashes the app

Closes #1481

See merge request framasoft/mobilizon!1565
This commit is contained in:
setop 2024-07-06 17:07:32 +00:00
commit 545cb81797
2 changed files with 13 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<o-taginput <o-taginput
:modelValue="modelValueWithDisplayName" :modelValue="modelValueWithDisplayName"
@update:modelValue="(val: IActor[]) => $emit('update:modelValue', val)" @update:modelValue="updateTags"
:data="availableActors" :data="availableActors"
:allow-autocomplete="true" :allow-autocomplete="true"
:allow-new="false" :allow-new="false"
@ -25,12 +25,16 @@ import { computed, ref } from "vue";
import ActorInline from "./ActorInline.vue"; import ActorInline from "./ActorInline.vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
const props = defineProps<{ const emit = defineEmits<{
modelValue: IActor[]; "update:modelValue": [value: IActor[]];
}>(); }>();
defineEmits<{ const updateTags = (val: IActor[]) => {
"update:modelValue": [value: IActor[]]; emit("update:modelValue", val);
};
const props = defineProps<{
modelValue: IActor[];
}>(); }>();
const modelValue = computed(() => props.modelValue); const modelValue = computed(() => props.modelValue);

View File

@ -16,12 +16,15 @@ export const ACTOR_FRAGMENT = gql`
} }
`; `;
// Do not request mediaSize here because mediaSize can only be accessed
// by user_himself/moderator/administrator (can_get_actor_size? in media.ex)
// - FETCH_PERSON is used by <NewConversation> and can be used by simple users here
// - FETCH_PERSON is also used in <EditIdentity> but mediaSize is not used there
export const FETCH_PERSON = gql` export const FETCH_PERSON = gql`
query FetchPerson($username: String!) { query FetchPerson($username: String!) {
fetchPerson(preferredUsername: $username) { fetchPerson(preferredUsername: $username) {
...ActorFragment ...ActorFragment
suspended suspended
mediaSize
avatar { avatar {
id id
name name