Skip to content

Commit

Permalink
Merge pull request #88 from Yeghro/main
Browse files Browse the repository at this point in the history
fix autohide function
  • Loading branch information
bitkarrot authored Oct 22, 2024
2 parents a998b6d + da78e89 commit f2f6f5e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -3603,9 +3603,11 @@ function loadSettingsFromLocalStorage() {
switchPitchBar.checked = isPitchBarEnabled;
switchSounds.checked = isSoundEnabled;
switchShare.checked = notify;
isButtonsBarOver = localStorageSettings.keep_buttons_visible || false;
document.getElementById('switchKeepButtonsVisible').checked = isButtonsBarOver;

isButtonsBarOver = false;
const keepVisible = localStorageSettings.keep_buttons_visible || false;
document.getElementById('switchKeepButtonsVisible').checked = keepVisible;
localStorageSettings.keep_buttons_visible = keepVisible;

recPrioritizeH264 = localStorageSettings.rec_prioritize_h264;
switchH264Recording.checked = recPrioritizeH264;

Expand Down Expand Up @@ -3980,19 +3982,19 @@ function showButtons() {

function checkButtonsBar() {
if (localStorageSettings.keep_buttons_visible) {
// If keep_buttons_visible is true, always show the buttons
toggleButtonsBar('show');
isButtonsVisible = true;
} else {
// If keep_buttons_visible is false, toggle as before
if (!isButtonsVisible) {
toggleButtonsBar('show');
isButtonsVisible = true;
} else {
if (!isButtonsBarOver && isButtonsVisible) { // Only hide if visible and not being hovered
toggleButtonsBar('hide');
bottomButtons.style.display = 'none';
isButtonsVisible = false;
}
}

setTimeout(() => {
checkButtonsBar();
}, 10000);
}

function toggleButtonsBar(action = 'toggle') {
Expand Down

0 comments on commit f2f6f5e

Please sign in to comment.