changed services to add join message

This commit is contained in:
hugogogo
2023-01-09 20:02:35 +01:00
parent ea395ce1af
commit 5184097765
7 changed files with 82 additions and 276 deletions

View File

@@ -3890,6 +3890,7 @@ var app = (function () {
}
async function join_room(room_name) {
console.log("in join_room");
console.log(room_name);
let name = {
room_name: room_name,
};
@@ -3915,7 +3916,7 @@ var app = (function () {
let data = await response.json();
console.log(data.message);
await get_room_messages();
socket$1.emit('join', name);
socket$1.emit('change', name);
room_name.set(name);
layout.set("room");
}
@@ -4665,7 +4666,7 @@ var app = (function () {
}
// (39:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
function create_default_slot_4$4(ctx) {
function create_default_slot_4$3(ctx) {
let t;
const block = {
@@ -4682,7 +4683,7 @@ var app = (function () {
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_4$4.name,
id: create_default_slot_4$3.name,
type: "slot",
source: "(39:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
ctx
@@ -4892,7 +4893,7 @@ var app = (function () {
new_layout: /*back*/ ctx[0],
my_class: "back icon",
my_title: "go back " + /*back*/ ctx[0],
$$slots: { default: [create_default_slot_4$4] },
$$slots: { default: [create_default_slot_4$3] },
$$scope: { ctx }
},
$$inline: true
@@ -5258,7 +5259,7 @@ var app = (function () {
}
// (37:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
function create_default_slot_4$3(ctx) {
function create_default_slot_4$2(ctx) {
let t;
const block = {
@@ -5275,7 +5276,7 @@ var app = (function () {
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_4$3.name,
id: create_default_slot_4$2.name,
type: "slot",
source: "(37:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
ctx
@@ -5631,7 +5632,7 @@ var app = (function () {
new_layout: /*back*/ ctx[0],
my_class: "back icon",
my_title: "go back " + /*back*/ ctx[0],
$$slots: { default: [create_default_slot_4$3] },
$$slots: { default: [create_default_slot_4$2] },
$$scope: { ctx }
},
$$inline: true
@@ -6184,7 +6185,7 @@ var app = (function () {
const file$l = "src/pieces/chat/Layout_room_set.svelte";
// (13:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
function create_default_slot_7$2(ctx) {
function create_default_slot_3$3(ctx) {
let t;
const block = {
@@ -6201,7 +6202,7 @@ var app = (function () {
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_7$2.name,
id: create_default_slot_3$3.name,
type: "slot",
source: "(13:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
ctx
@@ -6211,7 +6212,7 @@ var app = (function () {
}
// (18:1) <Button my_class="room_name deactivate">
function create_default_slot_6$2(ctx) {
function create_default_slot_2$6(ctx) {
let t;
const block = {
@@ -6228,7 +6229,7 @@ var app = (function () {
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_6$2.name,
id: create_default_slot_2$6.name,
type: "slot",
source: "(18:1) <Button my_class=\\\"room_name deactivate\\\">",
ctx
@@ -6238,7 +6239,7 @@ var app = (function () {
}
// (23:1) <Button new_layout="close" my_class="close icon">
function create_default_slot_5$2(ctx) {
function create_default_slot_1$6(ctx) {
let t;
const block = {
@@ -6255,7 +6256,7 @@ var app = (function () {
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_5$2.name,
id: create_default_slot_1$6.name,
type: "slot",
source: "(23:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
ctx
@@ -6265,7 +6266,7 @@ var app = (function () {
}
// (29:2) <Button new_layout="create" my_class="create">
function create_default_slot_4$2(ctx) {
function create_default_slot$7(ctx) {
let t;
const block = {
@@ -6280,119 +6281,11 @@ var app = (function () {
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_4$2.name,
type: "slot",
source: "(29:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
ctx
});
return block;
}
// (39:3) <Button new_layout="user" my_class="list">
function create_default_slot_3$3(ctx) {
let t;
const block = {
c: function create() {
t = text("user 1");
},
m: function mount(target, anchor) {
insert_dev(target, t, anchor);
},
d: function destroy(detaching) {
if (detaching) detach_dev(t);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_3$3.name,
type: "slot",
source: "(39:3) <Button new_layout=\\\"user\\\" my_class=\\\"list\\\">",
ctx
});
return block;
}
// (42:3) <Button new_layout="user" my_class="list blocked">
function create_default_slot_2$6(ctx) {
let t;
const block = {
c: function create() {
t = text("user 2");
},
m: function mount(target, anchor) {
insert_dev(target, t, anchor);
},
d: function destroy(detaching) {
if (detaching) detach_dev(t);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_2$6.name,
type: "slot",
source: "(42:3) <Button new_layout=\\\"user\\\" my_class=\\\"list blocked\\\">",
ctx
});
return block;
}
// (45:3) <Button new_layout="user" my_class="list">
function create_default_slot_1$6(ctx) {
let t;
const block = {
c: function create() {
t = text("user 3");
},
m: function mount(target, anchor) {
insert_dev(target, t, anchor);
},
d: function destroy(detaching) {
if (detaching) detach_dev(t);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot_1$6.name,
type: "slot",
source: "(45:3) <Button new_layout=\\\"user\\\" my_class=\\\"list\\\">",
ctx
});
return block;
}
// (48:3) <Button new_layout="user" my_class="list">
function create_default_slot$7(ctx) {
let t;
const block = {
c: function create() {
t = text("user 4");
},
m: function mount(target, anchor) {
insert_dev(target, t, anchor);
},
d: function destroy(detaching) {
if (detaching) detach_dev(t);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_default_slot$7.name,
type: "slot",
source: "(48:3) <Button new_layout=\\\"user\\\" my_class=\\\"list\\\">",
source: "(29:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
ctx
});
@@ -6415,14 +6308,6 @@ var app = (function () {
let div1;
let div0;
let p1;
let t7;
let button4;
let t8;
let button5;
let t9;
let button6;
let t10;
let button7;
let current;
button0 = new Element_button({
@@ -6430,7 +6315,7 @@ var app = (function () {
new_layout: /*back*/ ctx[0],
my_class: "back icon",
my_title: "go back " + /*back*/ ctx[0],
$$slots: { default: [create_default_slot_7$2] },
$$slots: { default: [create_default_slot_3$3] },
$$scope: { ctx }
},
$$inline: true
@@ -6439,7 +6324,7 @@ var app = (function () {
button1 = new Element_button({
props: {
my_class: "room_name deactivate",
$$slots: { default: [create_default_slot_6$2] },
$$slots: { default: [create_default_slot_2$6] },
$$scope: { ctx }
},
$$inline: true
@@ -6449,7 +6334,7 @@ var app = (function () {
props: {
new_layout: "close",
my_class: "close icon",
$$slots: { default: [create_default_slot_5$2] },
$$slots: { default: [create_default_slot_1$6] },
$$scope: { ctx }
},
$$inline: true
@@ -6459,46 +6344,6 @@ var app = (function () {
props: {
new_layout: "create",
my_class: "create",
$$slots: { default: [create_default_slot_4$2] },
$$scope: { ctx }
},
$$inline: true
});
button4 = new Element_button({
props: {
new_layout: "user",
my_class: "list",
$$slots: { default: [create_default_slot_3$3] },
$$scope: { ctx }
},
$$inline: true
});
button5 = new Element_button({
props: {
new_layout: "user",
my_class: "list blocked",
$$slots: { default: [create_default_slot_2$6] },
$$scope: { ctx }
},
$$inline: true
});
button6 = new Element_button({
props: {
new_layout: "user",
my_class: "list",
$$slots: { default: [create_default_slot_1$6] },
$$scope: { ctx }
},
$$inline: true
});
button7 = new Element_button({
props: {
new_layout: "user",
my_class: "list",
$$slots: { default: [create_default_slot$7] },
$$scope: { ctx }
},
@@ -6524,14 +6369,6 @@ var app = (function () {
div0 = element("div");
p1 = element("p");
p1.textContent = "/ there are no public rooms yet /";
t7 = space();
create_component(button4.$$.fragment);
t8 = space();
create_component(button5.$$.fragment);
t9 = space();
create_component(button6.$$.fragment);
t10 = space();
create_component(button7.$$.fragment);
add_location(p0, file$l, 31, 2, 593);
attr_dev(p1, "class", "__center");
add_location(p1, file$l, 34, 4, 682);
@@ -6563,14 +6400,6 @@ var app = (function () {
append_dev(div2, div1);
append_dev(div1, div0);
append_dev(div0, p1);
append_dev(div1, t7);
mount_component(button4, div1, null);
append_dev(div1, t8);
mount_component(button5, div1, null);
append_dev(div1, t9);
mount_component(button6, div1, null);
append_dev(div1, t10);
mount_component(button7, div1, null);
current = true;
},
p: function update(ctx, [dirty]) {
@@ -6604,34 +6433,6 @@ var app = (function () {
}
button3.$set(button3_changes);
const button4_changes = {};
if (dirty & /*$$scope*/ 2) {
button4_changes.$$scope = { dirty, ctx };
}
button4.$set(button4_changes);
const button5_changes = {};
if (dirty & /*$$scope*/ 2) {
button5_changes.$$scope = { dirty, ctx };
}
button5.$set(button5_changes);
const button6_changes = {};
if (dirty & /*$$scope*/ 2) {
button6_changes.$$scope = { dirty, ctx };
}
button6.$set(button6_changes);
const button7_changes = {};
if (dirty & /*$$scope*/ 2) {
button7_changes.$$scope = { dirty, ctx };
}
button7.$set(button7_changes);
},
i: function intro(local) {
if (current) return;
@@ -6639,10 +6440,6 @@ var app = (function () {
transition_in(button1.$$.fragment, local);
transition_in(button2.$$.fragment, local);
transition_in(button3.$$.fragment, local);
transition_in(button4.$$.fragment, local);
transition_in(button5.$$.fragment, local);
transition_in(button6.$$.fragment, local);
transition_in(button7.$$.fragment, local);
current = true;
},
o: function outro(local) {
@@ -6650,10 +6447,6 @@ var app = (function () {
transition_out(button1.$$.fragment, local);
transition_out(button2.$$.fragment, local);
transition_out(button3.$$.fragment, local);
transition_out(button4.$$.fragment, local);
transition_out(button5.$$.fragment, local);
transition_out(button6.$$.fragment, local);
transition_out(button7.$$.fragment, local);
current = false;
},
d: function destroy(detaching) {
@@ -6662,10 +6455,6 @@ var app = (function () {
destroy_component(button1);
destroy_component(button2);
destroy_component(button3);
destroy_component(button4);
destroy_component(button5);
destroy_component(button6);
destroy_component(button7);
}
};

File diff suppressed because one or more lines are too long

View File

@@ -35,7 +35,6 @@
<p class="__center">/ there are no public rooms yet /</p>
</div>
<!-- placeholders
------------- -->
<Button new_layout="user" my_class="list">
user 1
</Button>
@@ -48,6 +47,7 @@
<Button new_layout="user" my_class="list">
user 4
</Button>
------------- -->
<!-- END placeholders -->
</div>
</div>

View File

@@ -48,6 +48,7 @@ export async function create_room(room_name, room_type)
export async function join_room(room_name)
{
console.log("in join_room");
console.log(room_name);
let name = {
room_name: room_name,
@@ -79,7 +80,7 @@ export async function change_room(name)
console.log(data.message);
await get_room_messages();
socket.emit('join', name);
socket.emit('change', name);
room_name.set(name);
layout.set("room");