diff src/chat.js @ 46:42b741a1d5c6

add username
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 28 Feb 2025 19:25:12 -0700
parents e09747b199e9
children 7628fd0e3560
line wrap: on
line diff
--- a/src/chat.js	Fri Feb 28 14:37:11 2025 -0700
+++ b/src/chat.js	Fri Feb 28 19:25:12 2025 -0700
@@ -16,7 +16,7 @@
 	userEventSource.onmessage = evalEvent;
 }
 
-function selectChat(div) {
+function selectChat(div,email) {
 	document.querySelector('div[content]').setAttribute('show','posts');
 	let chatId = div.getAttribute('chat');
 	if( chatId === currentChatId )
@@ -26,7 +26,6 @@
 	div.setAttribute('selected','');
 	ajax(`get_chat.js?chat=${chatId}`);
 	currentChatId = chatId;
-	let email = div.querySelector('[email]').textContent;
 	history.replaceState(null,null,`?with=${email}`);
 
 	if(eventSource)  eventSource.close();