diff --git a/src/lib/WritingBar.svelte b/src/lib/WritingBar.svelte index e04f398..241fc2d 100644 --- a/src/lib/WritingBar.svelte +++ b/src/lib/WritingBar.svelte @@ -1,21 +1,29 @@ - -
\ No newline at end of file + input { + padding-left: 1.5%; + } + diff --git a/src/utils/utils.ts b/src/utils/utils.ts index ea1a01e..965021a 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -177,19 +177,6 @@ MyID.subscribe((value) => { ID = value; }); -message.subscribe((value) => { - testo = value; - - if (testo.length > 0 && conn != null && messageIsMineValue != 2 && validate(testo)) { - try { - messageIsMine.set(1); - conn.send(testo); - } catch (error) { - console.log('Errore: ' + error); - } - } -}); - messageIsMine.subscribe((value) => { messageIsMineValue = value; }); @@ -204,3 +191,14 @@ export function validate(text: string) { return true; } } + +export function actualSend(message: string) { + if (message.length > 0 && conn != null && messageIsMineValue != 2 && validate(message)) { + try { + messageIsMine.set(1); + conn.send(message); + } catch (error) { + console.log('Errore: ' + error); + } + } +}