diff --git a/src/webpage/channel.ts b/src/webpage/channel.ts index f830bf6..21d925c 100644 --- a/src/webpage/channel.ts +++ b/src/webpage/channel.ts @@ -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(); diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index 36ff5f2..3db855b 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -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"); diff --git a/src/webpage/settings.ts b/src/webpage/settings.ts index 83a1465..245948b 100644 --- a/src/webpage/settings.ts +++ b/src/webpage/settings.ts @@ -208,8 +208,8 @@ class CheckboxInput implements OptionsElement{ 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){