fix: hashrate changes incorrectly after changing metric

This commit is contained in:
mostafaei2002 2024-06-11 14:57:34 +03:30
parent f8f1260e1f
commit 8ea2462fe5

View file

@ -196,9 +196,11 @@ impl crate::disk::state::Xvb {
).on_hover_text(slider_help_text); ).on_hover_text(slider_help_text);
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() { if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() {
self.amount *= 1000;
self.manual_donation_metric = ManualDonationMetric::Hash; self.manual_donation_metric = ManualDonationMetric::Hash;
} }
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Kilo, "kH/s")).clicked() { if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Kilo, "kH/s")).clicked() {
self.amount /= 1000.0;
self.manual_donation_metric = ManualDonationMetric::Kilo; self.manual_donation_metric = ManualDonationMetric::Kilo;
}; };