Voice setting
This commit is contained in:
parent
abc63bc166
commit
7f51b6c89f
3 changed files with 21 additions and 2 deletions
|
@ -843,7 +843,7 @@ class Channel extends SnowFlake{
|
|||
loading.classList.add("loading");
|
||||
this.rendertyping();
|
||||
this.localuser.getSidePannel();
|
||||
if(this.voice){
|
||||
if(this.voice&&localStorage.getItem("Voice enabled")){
|
||||
this.localuser.joinVoice(this);
|
||||
}
|
||||
await this.putmessages();
|
||||
|
|
|
@ -1254,6 +1254,25 @@ class Localuser{
|
|||
{ initColor: userinfos.accent_color }
|
||||
);
|
||||
}
|
||||
{
|
||||
const box=tas.addCheckboxInput("Enable experimental Voice support",()=>{},{initState:Boolean(localStorage.getItem("Voice enabled"))});
|
||||
box.onchange=(e)=>{
|
||||
if(e){
|
||||
if(confirm("Are you sure you want to enable this, this is very experimental and is likely to cause issues")){
|
||||
localStorage.setItem("Voice enabled","true")
|
||||
|
||||
}else{
|
||||
box.value=true;
|
||||
const checkbox=box.input.deref();
|
||||
if(checkbox){
|
||||
checkbox.checked=false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
localStorage.removeItem("Voice enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
const security = settings.addButton("Account Settings");
|
||||
|
|
|
@ -208,8 +208,8 @@ class CheckboxInput implements OptionsElement<boolean>{
|
|||
const input = this.input.deref();
|
||||
if(input){
|
||||
const value = input.checked as boolean;
|
||||
this.onchange(value);
|
||||
this.value = value;
|
||||
this.onchange(value);
|
||||
}
|
||||
}
|
||||
setState(state:boolean){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue