fixed mute bug

This commit is contained in:
Joshua Perry 2024-08-12 16:52:24 +01:00
parent 0cb56ba024
commit fb8f18b405
1 changed files with 5 additions and 1 deletions

View File

@ -38,10 +38,14 @@ fn step(directon: Direction) { //onscroll
}
/// Takes [u8] (saved_volume) and replaces the current volume with the value.
/// The current volume is stored within the `mute_save` eww variable.
fn toggle_mute(saved_volume: u8) { //onclick
fn toggle_mute(mut saved_volume: u8) { //onclick
use super::update_eww_var;
let volume = get_current_value();
if saved_volume > 0 && volume > 0 {
saved_volume = 0;
}
set(saved_volume, Direction::Absolute);
update_eww_var("mute_save", &volume.to_string());