Remember video mutality prefs on localStorage

This commit is contained in:
Noah 2023-03-31 20:25:53 -07:00
parent 4f61b8dc1c
commit 45ab63cfba
2 changed files with 13 additions and 2 deletions

View File

@ -292,6 +292,14 @@ const app = Vue.createApp({
if (localStorage.fontSizeClass != undefined) {
this.fontSizeClass = localStorage.fontSizeClass;
}
// Webcam mutality preferences from last broadcast.
if (localStorage.videoMutual === "true") {
this.webcam.mutual = true;
}
if (localStorage.videoMutualOpen === "true") {
this.webcam.mutualOpen = true;
}
},
signIn() {
@ -932,6 +940,10 @@ const app = Vue.createApp({
this.webcam.elem.srcObject = stream;
this.webcam.stream = stream;
// Save our mutuality prefs.
localStorage.videoMutual = this.webcam.mutual;
localStorage.videoMutualOpen = this.webcam.mutualOpen;
// Tell backend the camera is ready.
this.sendMe();
}).catch(err => {

View File

@ -256,7 +256,6 @@
<div class="field">
<label class="checkbox">
<input type="checkbox"
:disabled="!webcam.mutual"
v-model="webcam.mutualOpen">
When someone opens my camera, I also open their camera automatically
</label>
@ -387,7 +386,7 @@
'is-danger': webcam.nsfw}"
@click.prevent="webcam.nsfw = !webcam.nsfw; sendMe()"
title="Toggle the NSFW setting for your camera broadcast">
<i class="fa fa-fire"></i>
<i class="fa fa-fire mr-1"></i> Explicit
</button>
</div>
<div class="column is-narrow pl-1">