socket are working but it's not the right way

This commit is contained in:
hugogogo
2023-01-09 16:47:30 +01:00
parent e23699dd51
commit 3eb338d822
4 changed files with 14 additions and 7 deletions

View File

@@ -3854,6 +3854,10 @@ var app = (function () {
}
async function create_room(room_name, room_type) {
console.log("in create_room");
let form_data = {
room_name: room_name,
room_type: room_type,
};
// send the new room
const response = await fetch('/api/v2/chat/create', {
method: 'POST',
@@ -3898,6 +3902,7 @@ var app = (function () {
let data = await response.json();
console.log(data.message);
await get_room_messages();
socket$1.emit('join', name);
room_name.set(name);
layout.set("room");
}
@@ -7677,7 +7682,7 @@ var app = (function () {
if (!formIsValid) return;
// send the new room
const response = await create_room();
const response = await create_room(room_name, room_type);
// go to room
if (response.status === 200 && response.message === "successfull room creation") {

File diff suppressed because one or more lines are too long