fixes
parent
9e4e2ba299
commit
8cd970e4f8
|
@ -9,7 +9,7 @@ function chooseThread(thread) {
|
||||||
window.currentThreadId = thread.id;
|
window.currentThreadId = thread.id;
|
||||||
window.earliestMessage = null;
|
window.earliestMessage = null;
|
||||||
document.getElementById("messages").innerHTML = "";
|
document.getElementById("messages").innerHTML = "";
|
||||||
document.getElementById("threadname").innerHTML = thread.name;
|
document.getElementById("threadname").textContent = thread.name;
|
||||||
loadMessages();
|
loadMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,9 +51,8 @@ function addThread(thread) {
|
||||||
function addMember() {
|
function addMember() {
|
||||||
const name = document.getElementById("membername").value;
|
const name = document.getElementById("membername").value;
|
||||||
window.threadmembers.push(name);
|
window.threadmembers.push(name);
|
||||||
document.getElementById("memberlist").appendChild(html.node`
|
document.getElementById("memberlist").appendChild(
|
||||||
<p class='member'>${name}</p>
|
html.node`<p class='member'>${name}</p>`);
|
||||||
`);
|
|
||||||
document.getElementById("membername").value = "";
|
document.getElementById("membername").value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,11 +176,11 @@ render(document.body, html`
|
||||||
<div id="threadlist">loading...</div>
|
<div id="threadlist">loading...</div>
|
||||||
<button id='newthread' onclick=${newThread}>create</button>
|
<button id='newthread' onclick=${newThread}>create</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="chat" class="column">
|
<div id="thread" class="column">
|
||||||
<h3>
|
<h3>
|
||||||
thread: <strong id="threadname">meow</strong>
|
thread: <strong id="threadname">meow</strong>
|
||||||
</h3>
|
</h3>
|
||||||
<h3>messages will appear below as they are sent</h3>
|
<h3>messages</h3>
|
||||||
<button id="loadmore" class="hidden" onclick=${loadMessages}>load more messages</button>
|
<button id="loadmore" class="hidden" onclick=${loadMessages}>load more messages</button>
|
||||||
<div id="messages"></div>
|
<div id="messages"></div>
|
||||||
<form id="msginput" onsubmit=${sendMessage}>
|
<form id="msginput" onsubmit=${sendMessage}>
|
||||||
|
|
|
@ -57,7 +57,7 @@ const create_thread = async (msg, respond, socket, io) => {
|
||||||
for (let user of msg.members) {
|
for (let user of msg.members) {
|
||||||
// get user id
|
// get user id
|
||||||
const id = await db.query("select id from users where name = ?", [
|
const id = await db.query("select id from users where name = ?", [
|
||||||
user.user,
|
user.name,
|
||||||
]);
|
]);
|
||||||
if (id.rows.length > 0) {
|
if (id.rows.length > 0) {
|
||||||
const user_id = id.rows[0].id;
|
const user_id = id.rows[0].id;
|
||||||
|
|
Loading…
Reference in New Issue