diff --git a/ts/view/Communication.vue b/ts/view/Communication.vue index 788f0126..fa281727 100644 --- a/ts/view/Communication.vue +++ b/ts/view/Communication.vue @@ -735,7 +735,6 @@ onMounted(() => { // Refs const apiBase = ref("/api"); -const selectedCommunication = ref(null); const messageText = ref(""); const showPhotoModal = ref(false); const selectedId = ref(null); @@ -750,7 +749,16 @@ const mapRef = ref(null); const nuisance = computed(() => { return selectedCommunication.value?.public_report?.nuisance || null; }); - +const selectedCommunication = computed(() => { + if (selectedId.value == null) { + return null; + } + if (communication.all == null) { + return null; + } + const result = communication.all.find((c) => c.id == selectedId.value); + return result; +}); const water = computed(() => { return selectedCommunication.value?.public_report?.water || null; });