Voice setting

This commit is contained in:
MathMan05 2024-10-29 20:53:20 -05:00
parent abc63bc166
commit 7f51b6c89f
3 changed files with 21 additions and 2 deletions

View file

@ -843,7 +843,7 @@ class Channel extends SnowFlake{
loading.classList.add("loading"); loading.classList.add("loading");
this.rendertyping(); this.rendertyping();
this.localuser.getSidePannel(); this.localuser.getSidePannel();
if(this.voice){ if(this.voice&&localStorage.getItem("Voice enabled")){
this.localuser.joinVoice(this); this.localuser.joinVoice(this);
} }
await this.putmessages(); await this.putmessages();

View file

@ -1254,6 +1254,25 @@ class Localuser{
{ initColor: userinfos.accent_color } { 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"); const security = settings.addButton("Account Settings");

View file

@ -208,8 +208,8 @@ class CheckboxInput implements OptionsElement<boolean>{
const input = this.input.deref(); const input = this.input.deref();
if(input){ if(input){
const value = input.checked as boolean; const value = input.checked as boolean;
this.onchange(value);
this.value = value; this.value = value;
this.onchange(value);
} }
} }
setState(state:boolean){ setState(state:boolean){