From 40d7570bf2c84771bf9cc54f1932c6b72c7a257d Mon Sep 17 00:00:00 2001
From: mostafaei2002 <sinamostafaei2002@gmail.com>
Date: Tue, 11 Jun 2024 12:38:43 +0330
Subject: [PATCH] fix: slider metric

---
 src/app/panels/middle/xvb.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/app/panels/middle/xvb.rs b/src/app/panels/middle/xvb.rs
index add4d93..7311e4e 100644
--- a/src/app/panels/middle/xvb.rs
+++ b/src/app/panels/middle/xvb.rs
@@ -195,8 +195,11 @@ impl crate::disk::state::Xvb {
                                         egui::Slider::new(&mut self.amount, 0.0..=(hashrate_xmrig as f64))
                                     ).on_hover_text(slider_help_text);
 
-                                    ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s"));
+                                    if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() {
+                                        self.manual_donation_metric = ManualDonationMetric::Hash;
+                                    }
                                     if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Kilo, "kH/s")).clicked() {
+                                        self.manual_donation_metric = ManualDonationMetric::Kilo;
                                         self.amount *= 1000.0;
                                     };