creation of directs messages
+ can choose myrooms fields + trying to make type validation without success
This commit is contained in:
@@ -3867,27 +3867,21 @@ var app = (function () {
|
||||
});
|
||||
msgs.set(messages);
|
||||
}
|
||||
async function create_room(room_name, room_type) {
|
||||
async function create_room(room) {
|
||||
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',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(form_data),
|
||||
body: JSON.stringify(room),
|
||||
});
|
||||
// get response status and message
|
||||
let response_status = response.status;
|
||||
let data = await response.json();
|
||||
let response_message = "";
|
||||
if (data.message)
|
||||
response_message = data.message;
|
||||
return {
|
||||
status: response_status,
|
||||
message: response_message
|
||||
message: data.message,
|
||||
room: data.room,
|
||||
};
|
||||
}
|
||||
async function join_room(room) {
|
||||
@@ -3902,6 +3896,7 @@ var app = (function () {
|
||||
}
|
||||
async function change_room(room) {
|
||||
console.log("in change_room");
|
||||
console.log("room:", room);
|
||||
const response = await fetch('/api/v2/chat/change', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@@ -3922,6 +3917,7 @@ var app = (function () {
|
||||
console.log("in get_my_rooms");
|
||||
const response = await fetch('/api/v2/chat/myrooms');
|
||||
const data = await response.json();
|
||||
console.log("data.rooms:", data.rooms);
|
||||
return data.rooms;
|
||||
}
|
||||
async function get_all_rooms() {
|
||||
@@ -3950,11 +3946,11 @@ var app = (function () {
|
||||
|
||||
function get_each_context$8(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[2] = list[i];
|
||||
child_ctx[3] = list[i];
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (23:1) <Button new_layout="settings" my_class="settings dots icon">
|
||||
// (25:1) <Button new_layout="settings" my_class="settings dots icon">
|
||||
function create_default_slot_3$6(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -3974,14 +3970,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_3$6.name,
|
||||
type: "slot",
|
||||
source: "(23:1) <Button new_layout=\\\"settings\\\" my_class=\\\"settings dots icon\\\">",
|
||||
source: "(25:1) <Button new_layout=\\\"settings\\\" my_class=\\\"settings dots icon\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (28:1) <Button new_layout="new" my_class="new transparent">
|
||||
// (30:1) <Button new_layout="new" my_class="new transparent">
|
||||
function create_default_slot_2$a(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -4001,14 +3997,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_2$a.name,
|
||||
type: "slot",
|
||||
source: "(28:1) <Button new_layout=\\\"new\\\" my_class=\\\"new transparent\\\">",
|
||||
source: "(30:1) <Button new_layout=\\\"new\\\" my_class=\\\"new transparent\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (33:1) <Button new_layout="close" my_class="close icon">
|
||||
// (35:1) <Button new_layout="close" my_class="close icon">
|
||||
function create_default_slot_1$a(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -4028,7 +4024,7 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_1$a.name,
|
||||
type: "slot",
|
||||
source: "(33:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
source: "(35:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
@@ -4057,7 +4053,7 @@ var app = (function () {
|
||||
return block;
|
||||
}
|
||||
|
||||
// (46:3) {:then rooms}
|
||||
// (48:3) {:then rooms}
|
||||
function create_then_block$3(ctx) {
|
||||
let each_1_anchor;
|
||||
let current;
|
||||
@@ -4146,16 +4142,16 @@ var app = (function () {
|
||||
block,
|
||||
id: create_then_block$3.name,
|
||||
type: "then",
|
||||
source: "(46:3) {:then rooms}",
|
||||
source: "(48:3) {:then rooms}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (48:5) <Button my_class="list" on_click={go_to_room}>
|
||||
// (50:5) <Button my_class="list" on_click={function() {go_to_room(room)}}>
|
||||
function create_default_slot$b(ctx) {
|
||||
let t0_value = /*room*/ ctx[2].name + "";
|
||||
let t0_value = /*room*/ ctx[3].name + "";
|
||||
let t0;
|
||||
let t1;
|
||||
|
||||
@@ -4179,22 +4175,26 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot$b.name,
|
||||
type: "slot",
|
||||
source: "(48:5) <Button my_class=\\\"list\\\" on_click={go_to_room}>",
|
||||
source: "(50:5) <Button my_class=\\\"list\\\" on_click={function() {go_to_room(room)}}>",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (47:4) {#each rooms as room}
|
||||
// (49:4) {#each rooms as room}
|
||||
function create_each_block$8(ctx) {
|
||||
let button;
|
||||
let current;
|
||||
|
||||
function func() {
|
||||
return /*func*/ ctx[2](/*room*/ ctx[3]);
|
||||
}
|
||||
|
||||
button = new Element_button({
|
||||
props: {
|
||||
my_class: "list",
|
||||
on_click: /*go_to_room*/ ctx[0],
|
||||
on_click: func,
|
||||
$$slots: { default: [create_default_slot$b] },
|
||||
$$scope: { ctx }
|
||||
},
|
||||
@@ -4209,10 +4209,11 @@ var app = (function () {
|
||||
mount_component(button, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
const button_changes = {};
|
||||
|
||||
if (dirty & /*$$scope*/ 32) {
|
||||
if (dirty & /*$$scope*/ 64) {
|
||||
button_changes.$$scope = { dirty, ctx };
|
||||
}
|
||||
|
||||
@@ -4236,14 +4237,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_each_block$8.name,
|
||||
type: "each",
|
||||
source: "(47:4) {#each rooms as room}",
|
||||
source: "(49:4) {#each rooms as room}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (44:17) <p>rooms are loading...</p> {:then rooms}
|
||||
// (46:17) <p>rooms are loading...</p> {:then rooms}
|
||||
function create_pending_block$3(ctx) {
|
||||
let p;
|
||||
|
||||
@@ -4251,7 +4252,7 @@ var app = (function () {
|
||||
c: function create() {
|
||||
p = element("p");
|
||||
p.textContent = "rooms are loading...";
|
||||
add_location(p, file$q, 44, 4, 1002);
|
||||
add_location(p, file$q, 46, 4, 1018);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, p, anchor);
|
||||
@@ -4268,7 +4269,7 @@ var app = (function () {
|
||||
block,
|
||||
id: create_pending_block$3.name,
|
||||
type: "pending",
|
||||
source: "(44:17) <p>rooms are loading...</p> {:then rooms}",
|
||||
source: "(46:17) <p>rooms are loading...</p> {:then rooms}",
|
||||
ctx
|
||||
});
|
||||
|
||||
@@ -4356,17 +4357,17 @@ var app = (function () {
|
||||
t6 = space();
|
||||
info.block.c();
|
||||
attr_dev(p0, "class", "title svelte-1jygwt2");
|
||||
add_location(p0, file$q, 38, 2, 806);
|
||||
add_location(p0, file$q, 40, 2, 822);
|
||||
attr_dev(p1, "class", "__center");
|
||||
add_location(p1, file$q, 41, 4, 916);
|
||||
add_location(p1, file$q, 43, 4, 932);
|
||||
attr_dev(div0, "class", "__show_if_only_child");
|
||||
add_location(div0, file$q, 40, 3, 877);
|
||||
add_location(div0, file$q, 42, 3, 893);
|
||||
attr_dev(div1, "class", "room_list");
|
||||
add_location(div1, file$q, 39, 2, 850);
|
||||
add_location(div1, file$q, 41, 2, 866);
|
||||
attr_dev(div2, "class", "panel panel_home __border_top svelte-1jygwt2");
|
||||
add_location(div2, file$q, 37, 1, 760);
|
||||
add_location(div2, file$q, 39, 1, 776);
|
||||
attr_dev(div3, "class", "grid_box svelte-1jygwt2");
|
||||
add_location(div3, file$q, 19, 0, 437);
|
||||
add_location(div3, file$q, 21, 0, 453);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
@@ -4395,21 +4396,21 @@ var app = (function () {
|
||||
ctx = new_ctx;
|
||||
const button0_changes = {};
|
||||
|
||||
if (dirty & /*$$scope*/ 32) {
|
||||
if (dirty & /*$$scope*/ 64) {
|
||||
button0_changes.$$scope = { dirty, ctx };
|
||||
}
|
||||
|
||||
button0.$set(button0_changes);
|
||||
const button1_changes = {};
|
||||
|
||||
if (dirty & /*$$scope*/ 32) {
|
||||
if (dirty & /*$$scope*/ 64) {
|
||||
button1_changes.$$scope = { dirty, ctx };
|
||||
}
|
||||
|
||||
button1.$set(button1_changes);
|
||||
const button2_changes = {};
|
||||
|
||||
if (dirty & /*$$scope*/ 32) {
|
||||
if (dirty & /*$$scope*/ 64) {
|
||||
button2_changes.$$scope = { dirty, ctx };
|
||||
}
|
||||
|
||||
@@ -4464,9 +4465,10 @@ var app = (function () {
|
||||
let rooms = get_my_rooms();
|
||||
|
||||
// go to clicked room
|
||||
async function go_to_room(evt) {
|
||||
async function go_to_room(room) {
|
||||
console.log("inside go_to_room");
|
||||
await change_room(evt.target.innerText);
|
||||
console.log("room:", room);
|
||||
await change_room(room);
|
||||
await get_room_messages();
|
||||
}
|
||||
|
||||
@@ -4476,6 +4478,10 @@ var app = (function () {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$d.warn(`<Layout_home> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
const func = function (room) {
|
||||
go_to_room(room);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
layout,
|
||||
msgs,
|
||||
@@ -4497,7 +4503,7 @@ var app = (function () {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [go_to_room, rooms];
|
||||
return [go_to_room, rooms, func];
|
||||
}
|
||||
|
||||
class Layout_home extends SvelteComponentDev {
|
||||
@@ -5269,7 +5275,7 @@ var app = (function () {
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (20:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
||||
// (19:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
||||
function create_default_slot_4$3(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -5289,14 +5295,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_4$3.name,
|
||||
type: "slot",
|
||||
source: "(20:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
||||
source: "(19:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (25:1) <Button my_class="new deactivate">
|
||||
// (24:1) <Button my_class="new deactivate">
|
||||
function create_default_slot_3$4(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -5316,14 +5322,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_3$4.name,
|
||||
type: "slot",
|
||||
source: "(25:1) <Button my_class=\\\"new deactivate\\\">",
|
||||
source: "(24:1) <Button my_class=\\\"new deactivate\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (30:1) <Button new_layout="close" my_class="close icon">
|
||||
// (29:1) <Button new_layout="close" my_class="close icon">
|
||||
function create_default_slot_2$8(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -5343,14 +5349,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_2$8.name,
|
||||
type: "slot",
|
||||
source: "(30:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
source: "(29:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (36:2) <Button new_layout="create" my_class="create">
|
||||
// (35:2) <Button new_layout="create" my_class="create">
|
||||
function create_default_slot_1$8(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -5370,7 +5376,7 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_1$8.name,
|
||||
type: "slot",
|
||||
source: "(36:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
|
||||
source: "(35:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
@@ -5399,7 +5405,7 @@ var app = (function () {
|
||||
return block;
|
||||
}
|
||||
|
||||
// (46:3) {:then rooms}
|
||||
// (45:3) {:then rooms}
|
||||
function create_then_block$2(ctx) {
|
||||
let each_1_anchor;
|
||||
let current;
|
||||
@@ -5488,14 +5494,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_then_block$2.name,
|
||||
type: "then",
|
||||
source: "(46:3) {:then rooms}",
|
||||
source: "(45:3) {:then rooms}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (48:5) <Button my_class="list" on_click={function() {join_rooms(room)}}>
|
||||
// (47:5) <Button my_class="list" on_click={function() {join_rooms(room)}}>
|
||||
function create_default_slot$9(ctx) {
|
||||
let t0_value = /*room*/ ctx[4].name + "";
|
||||
let t0;
|
||||
@@ -5521,14 +5527,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot$9.name,
|
||||
type: "slot",
|
||||
source: "(48:5) <Button my_class=\\\"list\\\" on_click={function() {join_rooms(room)}}>",
|
||||
source: "(47:5) <Button my_class=\\\"list\\\" on_click={function() {join_rooms(room)}}>",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (47:4) {#each rooms as room}
|
||||
// (46:4) {#each rooms as room}
|
||||
function create_each_block$6(ctx) {
|
||||
let button;
|
||||
let current;
|
||||
@@ -5583,14 +5589,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_each_block$6.name,
|
||||
type: "each",
|
||||
source: "(47:4) {#each rooms as room}",
|
||||
source: "(46:4) {#each rooms as room}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (44:17) <p>rooms are loading...</p> {:then rooms}
|
||||
// (43:17) <p>rooms are loading...</p> {:then rooms}
|
||||
function create_pending_block$2(ctx) {
|
||||
let p;
|
||||
|
||||
@@ -5598,7 +5604,7 @@ var app = (function () {
|
||||
c: function create() {
|
||||
p = element("p");
|
||||
p.textContent = "rooms are loading...";
|
||||
add_location(p, file$n, 44, 4, 1114);
|
||||
add_location(p, file$n, 43, 4, 1082);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, p, anchor);
|
||||
@@ -5615,7 +5621,7 @@ var app = (function () {
|
||||
block,
|
||||
id: create_pending_block$2.name,
|
||||
type: "pending",
|
||||
source: "(44:17) <p>rooms are loading...</p> {:then rooms}",
|
||||
source: "(43:17) <p>rooms are loading...</p> {:then rooms}",
|
||||
ctx
|
||||
});
|
||||
|
||||
@@ -5716,17 +5722,17 @@ var app = (function () {
|
||||
p1.textContent = "/ there are no public rooms yet /";
|
||||
t7 = space();
|
||||
info.block.c();
|
||||
add_location(p0, file$n, 38, 2, 934);
|
||||
add_location(p0, file$n, 37, 2, 902);
|
||||
attr_dev(p1, "class", "__center");
|
||||
add_location(p1, file$n, 41, 4, 1024);
|
||||
add_location(p1, file$n, 40, 4, 992);
|
||||
attr_dev(div0, "class", "__show_if_only_child");
|
||||
add_location(div0, file$n, 40, 3, 985);
|
||||
add_location(div0, file$n, 39, 3, 953);
|
||||
attr_dev(div1, "class", "public_rooms");
|
||||
add_location(div1, file$n, 39, 2, 955);
|
||||
add_location(div1, file$n, 38, 2, 923);
|
||||
attr_dev(div2, "class", "panel panel_new __border_top");
|
||||
add_location(div2, file$n, 34, 1, 818);
|
||||
add_location(div2, file$n, 33, 1, 786);
|
||||
attr_dev(div3, "class", "grid_box svelte-1b4c0qx");
|
||||
add_location(div3, file$n, 16, 0, 509);
|
||||
add_location(div3, file$n, 15, 0, 477);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
@@ -5842,7 +5848,6 @@ var app = (function () {
|
||||
async function join_rooms(room) {
|
||||
console.log("inside join_room");
|
||||
console.log("room:", room);
|
||||
console.log("room:", room);
|
||||
const updated_room = await join_room(room);
|
||||
console.log("updated room:", updated_room);
|
||||
await change_room(updated_room);
|
||||
@@ -7270,7 +7275,7 @@ var app = (function () {
|
||||
const { console: console_1$9 } = globals;
|
||||
const file$i = "src/pieces/chat/Layout_create.svelte";
|
||||
|
||||
// (38:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
||||
// (42:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
||||
function create_default_slot_2$4(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -7290,14 +7295,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_2$4.name,
|
||||
type: "slot",
|
||||
source: "(38:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
||||
source: "(42:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (43:1) <Button my_class="create deactivate">
|
||||
// (47:1) <Button my_class="create deactivate">
|
||||
function create_default_slot_1$4(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -7317,14 +7322,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot_1$4.name,
|
||||
type: "slot",
|
||||
source: "(43:1) <Button my_class=\\\"create deactivate\\\">",
|
||||
source: "(47:1) <Button my_class=\\\"create deactivate\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (48:1) <Button new_layout="close" my_class="close icon">
|
||||
// (52:1) <Button new_layout="close" my_class="close icon">
|
||||
function create_default_slot$5(ctx) {
|
||||
let t;
|
||||
|
||||
@@ -7344,14 +7349,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_default_slot$5.name,
|
||||
type: "slot",
|
||||
source: "(48:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
source: "(52:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (55:3) {#if response.status >= 300}
|
||||
// (59:3) {#if response.status >= 300}
|
||||
function create_if_block_1$5(ctx) {
|
||||
let warning;
|
||||
let current;
|
||||
@@ -7392,14 +7397,14 @@ var app = (function () {
|
||||
block,
|
||||
id: create_if_block_1$5.name,
|
||||
type: "if",
|
||||
source: "(55:3) {#if response.status >= 300}",
|
||||
source: "(59:3) {#if response.status >= 300}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (80:3) {#if room_type === 'protected'}
|
||||
// (84:3) {#if room_type === 'protected'}
|
||||
function create_if_block$b(ctx) {
|
||||
let div;
|
||||
let label;
|
||||
@@ -7418,10 +7423,10 @@ var app = (function () {
|
||||
t1 = space();
|
||||
input = element("input");
|
||||
attr_dev(p, "class", "svelte-1ulnmwp");
|
||||
add_location(p, file$i, 81, 28, 2570);
|
||||
add_location(p, file$i, 85, 28, 2632);
|
||||
attr_dev(label, "for", "chat_pswd");
|
||||
attr_dev(label, "class", "svelte-1ulnmwp");
|
||||
add_location(label, file$i, 81, 5, 2547);
|
||||
add_location(label, file$i, 85, 5, 2609);
|
||||
attr_dev(input, "id", "chat_pswd");
|
||||
attr_dev(input, "type", "password");
|
||||
attr_dev(input, "placeholder", "minimum 8 characters");
|
||||
@@ -7429,9 +7434,9 @@ var app = (function () {
|
||||
attr_dev(input, "name", "password");
|
||||
input.required = true;
|
||||
attr_dev(input, "class", "svelte-1ulnmwp");
|
||||
add_location(input, file$i, 82, 5, 2610);
|
||||
add_location(input, file$i, 86, 5, 2672);
|
||||
attr_dev(div, "class", "svelte-1ulnmwp");
|
||||
add_location(div, file$i, 80, 4, 2536);
|
||||
add_location(div, file$i, 84, 4, 2598);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div, anchor);
|
||||
@@ -7462,7 +7467,7 @@ var app = (function () {
|
||||
block,
|
||||
id: create_if_block$b.name,
|
||||
type: "if",
|
||||
source: "(80:3) {#if room_type === 'protected'}",
|
||||
source: "(84:3) {#if room_type === 'protected'}",
|
||||
ctx
|
||||
});
|
||||
|
||||
@@ -7581,18 +7586,18 @@ var app = (function () {
|
||||
t16 = space();
|
||||
input4 = element("input");
|
||||
attr_dev(p0, "class", "svelte-1ulnmwp");
|
||||
add_location(p0, file$i, 58, 26, 1500);
|
||||
add_location(p0, file$i, 62, 26, 1562);
|
||||
attr_dev(label0, "for", "chat_name");
|
||||
attr_dev(label0, "class", "svelte-1ulnmwp");
|
||||
add_location(label0, file$i, 58, 3, 1477);
|
||||
add_location(label0, file$i, 62, 3, 1539);
|
||||
attr_dev(input0, "id", "chat_name");
|
||||
attr_dev(input0, "name", "room_name");
|
||||
attr_dev(input0, "placeholder", input0_placeholder_value = "allowed special characters: " + /*allowed_chars*/ ctx[1]);
|
||||
input0.required = true;
|
||||
attr_dev(input0, "class", "svelte-1ulnmwp");
|
||||
add_location(input0, file$i, 62, 3, 1699);
|
||||
add_location(input0, file$i, 66, 3, 1761);
|
||||
attr_dev(p1, "class", "svelte-1ulnmwp");
|
||||
add_location(p1, file$i, 65, 4, 1900);
|
||||
add_location(p1, file$i, 69, 4, 1962);
|
||||
attr_dev(input1, "id", "chat_public");
|
||||
attr_dev(input1, "type", "radio");
|
||||
attr_dev(input1, "name", "room_type");
|
||||
@@ -7601,12 +7606,12 @@ var app = (function () {
|
||||
input1.required = true;
|
||||
attr_dev(input1, "class", "svelte-1ulnmwp");
|
||||
/*$$binding_groups*/ ctx[9][0].push(input1);
|
||||
add_location(input1, file$i, 66, 4, 1918);
|
||||
add_location(input1, file$i, 70, 4, 1980);
|
||||
attr_dev(label1, "for", "chat_public");
|
||||
attr_dev(label1, "class", "_radio svelte-1ulnmwp");
|
||||
add_location(label1, file$i, 64, 3, 1855);
|
||||
add_location(label1, file$i, 68, 3, 1917);
|
||||
attr_dev(p2, "class", "svelte-1ulnmwp");
|
||||
add_location(p2, file$i, 70, 4, 2111);
|
||||
add_location(p2, file$i, 74, 4, 2173);
|
||||
attr_dev(input2, "id", "chat_private");
|
||||
attr_dev(input2, "type", "radio");
|
||||
attr_dev(input2, "name", "room_type");
|
||||
@@ -7615,12 +7620,12 @@ var app = (function () {
|
||||
input2.required = true;
|
||||
attr_dev(input2, "class", "svelte-1ulnmwp");
|
||||
/*$$binding_groups*/ ctx[9][0].push(input2);
|
||||
add_location(input2, file$i, 71, 4, 2130);
|
||||
add_location(input2, file$i, 75, 4, 2192);
|
||||
attr_dev(label2, "for", "chat_private");
|
||||
attr_dev(label2, "class", "_radio hide svelte-1ulnmwp");
|
||||
add_location(label2, file$i, 69, 3, 2060);
|
||||
add_location(label2, file$i, 73, 3, 2122);
|
||||
attr_dev(p3, "class", "svelte-1ulnmwp");
|
||||
add_location(p3, file$i, 75, 4, 2329);
|
||||
add_location(p3, file$i, 79, 4, 2391);
|
||||
attr_dev(input3, "id", "chat_protected");
|
||||
attr_dev(input3, "type", "radio");
|
||||
attr_dev(input3, "name", "room_type");
|
||||
@@ -7629,20 +7634,20 @@ var app = (function () {
|
||||
input3.required = true;
|
||||
attr_dev(input3, "class", "svelte-1ulnmwp");
|
||||
/*$$binding_groups*/ ctx[9][0].push(input3);
|
||||
add_location(input3, file$i, 76, 4, 2350);
|
||||
add_location(input3, file$i, 80, 4, 2412);
|
||||
attr_dev(label3, "for", "chat_protected");
|
||||
attr_dev(label3, "class", "_radio hide svelte-1ulnmwp");
|
||||
add_location(label3, file$i, 74, 3, 2276);
|
||||
add_location(label3, file$i, 78, 3, 2338);
|
||||
attr_dev(input4, "type", "submit");
|
||||
input4.value = "⮡";
|
||||
attr_dev(input4, "class", "svelte-1ulnmwp");
|
||||
add_location(input4, file$i, 85, 3, 2774);
|
||||
add_location(input4, file$i, 89, 3, 2836);
|
||||
attr_dev(form, "class", "svelte-1ulnmwp");
|
||||
add_location(form, file$i, 53, 2, 1326);
|
||||
add_location(form, file$i, 57, 2, 1388);
|
||||
attr_dev(div0, "class", "panel panel_create __border_top svelte-1ulnmwp");
|
||||
add_location(div0, file$i, 52, 1, 1278);
|
||||
add_location(div0, file$i, 56, 1, 1340);
|
||||
attr_dev(div1, "class", "grid_box svelte-1ulnmwp");
|
||||
add_location(div1, file$i, 34, 0, 957);
|
||||
add_location(div1, file$i, 38, 0, 1019);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
@@ -7844,12 +7849,13 @@ var app = (function () {
|
||||
async function handleSubmit(evt) {
|
||||
let formIsValid = evt.target.checkValidity();
|
||||
if (!formIsValid) return;
|
||||
let room = { name: room_name, type: room_type };
|
||||
|
||||
// send the new room
|
||||
$$invalidate(5, response = await create_room(room_name, room_type));
|
||||
$$invalidate(5, response = await create_room(room));
|
||||
|
||||
// go to room
|
||||
if (response.status === 200) await change_room(room_name);
|
||||
if (response.status === 200) await change_room(response.room);
|
||||
}
|
||||
|
||||
const writable_props = ['back'];
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user