@@ -49,7 +65,7 @@
:class="{
active: selectedCommunication && selectedCommunication.id === comm.id,
}"
- @click="selectCommunication(comm)"
+ @click="handleClick(comm.id)"
>
@@ -118,16 +134,38 @@
diff --git a/ts/view/Communication.vue b/ts/view/Communication.vue
index 656c3630..788f0126 100644
--- a/ts/view/Communication.vue
+++ b/ts/view/Communication.vue
@@ -1,9 +1,75 @@
+
-
+
@@ -672,6 +738,7 @@ const apiBase = ref("/api");
const selectedCommunication = ref(null);
const messageText = ref("");
const showPhotoModal = ref(false);
+const selectedId = ref(null);
const currentPhotoIndex = ref(0);
const showToast = ref(false);
const toastTitle = ref("");
@@ -688,6 +755,9 @@ const water = computed(() => {
return selectedCommunication.value?.public_report?.water || null;
});
+const handleSelect = (id: string) => {
+ selectedId.value = id;
+};
async function fetchCommunications() {
await communication.fetchAll();
// if we already had something selected, reset it using the new data
@@ -700,12 +770,6 @@ async function fetchCommunications() {
}
}
}
-// Methods
-function filterMatches(filter, comm) {
- // Implement your filter logic here
- return true;
-}
-
function formatAddress(a) {
if (a.number === "" && a.street === "") {
return "no address provided";
@@ -746,12 +810,6 @@ async function loadFromAPI() {
}
}
-function selectCommunication(comm) {
- selectedCommunication.value = comm;
- messageText.value = "";
- updateMap();
-}
-
function openPhotoViewer(index) {
currentPhotoIndex.value = index;
showPhotoModal.value = true;
@@ -961,79 +1019,3 @@ onMounted(async () => {
}
});
-
-