Bugfix Richtungsstrich
This commit is contained in:
1 parent
821461bc07
commit
f1fb926c2f
3 files changed
+17
-8
No files matched your search
@@ -5,7 +5,7 @@
|
||||
* damit er sowohl die mobilen Views als auch die statischen Assets
|
||||
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
|
||||
*/
|
||||
const VERSION = 'cmbnet-pwa-v19';
|
||||
const VERSION = 'cmbnet-pwa-v21';
|
||||
const BASE = new URL('./', self.location).href;
|
||||
const SHELL_CACHE = `${VERSION}-shell`;
|
||||
const TILE_CACHE = `${VERSION}-tiles`;
|
||||
|
||||
@@ -1499,10 +1499,11 @@ function sendChat() {
|
||||
|
||||
function addChatEntry(entry) {
|
||||
const key = `${entry.code}|${entry.sender_id}|${entry.ts}|${entry.text}`;
|
||||
if (state.chatKeys.has(key)) return;
|
||||
if (state.chatKeys.has(key)) return false;
|
||||
state.chatKeys.add(key);
|
||||
state.chatMessages.push(entry);
|
||||
renderChat();
|
||||
return true;
|
||||
}
|
||||
|
||||
function renderChat() {
|
||||
@@ -1834,7 +1835,7 @@ function handleWs(event) {
|
||||
}
|
||||
|
||||
const senderName = getSenderName(message, payload);
|
||||
addChatEntry({
|
||||
const isNewMessage = addChatEntry({
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTs(message.ts) || Date.now(),
|
||||
@@ -1843,7 +1844,10 @@ function handleWs(event) {
|
||||
toName: getReceiverName(message, payload)
|
||||
});
|
||||
|
||||
if (Number(message.sender_id) !== currentAccountId) {
|
||||
// Wiederholt zugestellte Nachrichten (z. B. nach einem Reconnect)
|
||||
// dürfen weder Ton noch Dialog oder Systembenachrichtigung erneut
|
||||
// auslösen.
|
||||
if (isNewMessage && Number(message.sender_id) !== currentAccountId) {
|
||||
playSound();
|
||||
// In-App-Dialog und, sofern erlaubt, Systembenachrichtigung.
|
||||
showIncomingChatDialog(text, senderName);
|
||||
|
||||
Reference in new issue
Block a user