show addresses in front

This commit is contained in:
grimhilt
2023-04-03 20:37:07 +02:00
parent 6b4264fccc
commit fd253197cc
9 changed files with 317 additions and 55 deletions

View File

@@ -1,7 +1,9 @@
<script setup>
import { defineProps, onMounted, ref } from "vue";
import { decodeEmojis } from "../../utils/string";
import { removeDuplicates } from "../../utils/array";
import DOMPurify from "dompurify";
import store from "@/store/store";
const props = defineProps({ data: Object });
const date = new Date(props.data.date);
@@ -30,6 +32,17 @@ onMounted(() => {
`);
doc.close();
});
const displayAddresses = (addressesId) => {
// todo store members in rooms ?
addressesId = removeDuplicates(addressesId);
let res = "";
addressesId.forEach((addressId) => {
const address = store.getters.address(addressId);
if (address) res += address.email;
});
return res;
};
</script>
<!-- to if to is more than me
cc -->
@@ -39,7 +52,9 @@ onMounted(() => {
<template>
<div class="message">
<div id="context">
<div class="left" id="profile">{{ props.data.fromA }}</div>
<div class="left" id="profile">
{{ displayAddresses(props.data.fromA?.split(",")) }} - {{ props.data.fromA }}
</div>
<div class="middle">{{ decodeEmojis(props.data.subject) }}</div>
<div class="right" id="date">
{{