Dateien nach "frontend/src/tools" hochladen
This commit is contained in:
@@ -43,7 +43,7 @@ export default function Nachrichten({ toast, mobile }) {
|
|||||||
clearInterval(pollRef.current);
|
clearInterval(pollRef.current);
|
||||||
if (!activeUser) return;
|
if (!activeUser) return;
|
||||||
loadMessages(activeUser.id);
|
loadMessages(activeUser.id);
|
||||||
pollRef.current = setInterval(() => loadMessages(activeUser.id), 15_000);
|
pollRef.current = setInterval(() => loadMessages(activeUser.id), 10_000);
|
||||||
return () => clearInterval(pollRef.current);
|
return () => clearInterval(pollRef.current);
|
||||||
}, [activeUser?.id]);
|
}, [activeUser?.id]);
|
||||||
|
|
||||||
@@ -322,9 +322,15 @@ export default function Nachrichten({ toast, mobile }) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display:'flex', alignItems:'center', gap:5 }}>
|
<div style={{ display:'flex', alignItems:'center', gap:5 }}>
|
||||||
<span style={{ color:'rgba(255,255,255,0.18)', fontSize:9, fontFamily:'monospace' }}>
|
<span style={{ color:'rgba(255,255,255,0.18)', fontSize:9, fontFamily:'monospace', whiteSpace:'nowrap' }}>
|
||||||
{new Date(m.created_at).toLocaleTimeString('de-DE', { hour:'2-digit', minute:'2-digit' })}
|
{formatMsgTime(m.created_at)}
|
||||||
</span>
|
</span>
|
||||||
|
{isMine && (
|
||||||
|
<span title={m.read_by_recipient ? 'Gelesen' : 'Gesendet'}
|
||||||
|
style={{ fontSize:10, lineHeight:1, color: m.read_by_recipient ? '#4ecdc4' : 'rgba(255,255,255,0.2)' }}>
|
||||||
|
{m.read_by_recipient ? '✓✓' : '✓'}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<button onClick={() => deleteMsg(m.id)} style={{ background:'transparent', border:'none',
|
<button onClick={() => deleteMsg(m.id)} style={{ background:'transparent', border:'none',
|
||||||
cursor:'pointer', padding:'0 2px', opacity:0.3, lineHeight:1,
|
cursor:'pointer', padding:'0 2px', opacity:0.3, lineHeight:1,
|
||||||
display:'flex', alignItems:'center' }}>
|
display:'flex', alignItems:'center' }}>
|
||||||
@@ -380,3 +386,14 @@ function InfoBox({ color, children }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatMsgTime(isoStr) {
|
||||||
|
const d = new Date(isoStr);
|
||||||
|
const now = new Date();
|
||||||
|
const isToday = d.toDateString() === now.toDateString();
|
||||||
|
const isThisYear = d.getFullYear() === now.getFullYear();
|
||||||
|
const time = d.toLocaleTimeString('de-DE', { hour:'2-digit', minute:'2-digit' });
|
||||||
|
if (isToday) return time;
|
||||||
|
if (isThisYear) return `${d.toLocaleDateString('de-DE', { day:'numeric', month:'short' })} ${time}`;
|
||||||
|
return `${d.toLocaleDateString('de-DE', { day:'numeric', month:'short', year:'numeric' })} ${time}`;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user