fixed pbm in room name check
This commit is contained in:
@@ -9,13 +9,13 @@
|
||||
export let back = "";
|
||||
|
||||
let allowed_chars = 'loading...';
|
||||
let regex;
|
||||
//let regex;
|
||||
onMount(async() => {
|
||||
let response = await fetch('/api/v2/chat/allowedchars');
|
||||
let data = await response.json();
|
||||
console.log("data:", data);
|
||||
allowed_chars = data.chars;
|
||||
regex = new RegExp(`^[a-zA-Z0-9\\s${allowed_chars}]+$`);
|
||||
//regex = new RegExp(`^[a-zA-Z0-9\\s${allowed_chars}]+$`);
|
||||
});
|
||||
|
||||
let room_name: string;
|
||||
@@ -68,7 +68,10 @@
|
||||
{/if}
|
||||
<!-- name: -->
|
||||
<label for="chat_name"><p>new room name :</p></label>
|
||||
<!--
|
||||
<input id="chat_name" bind:value={room_name} name="room_name" placeholder="allowed special characters: {allowed_chars}" pattern={regex} required>
|
||||
-->
|
||||
<input id="chat_name" bind:value={room_name} name="room_name" placeholder="allowed special characters: {allowed_chars}" required>
|
||||
<!-- [ ] pubic -->
|
||||
<label for="chat_public" class="_radio">
|
||||
<p>public</p>
|
||||
|
||||
Reference in New Issue
Block a user