diff --git a/src/app/panels/middle/xvb.rs b/src/app/panels/middle/xvb.rs index 86adcaa..9fec213 100644 --- a/src/app/panels/middle/xvb.rs +++ b/src/app/panels/middle/xvb.rs @@ -167,13 +167,17 @@ impl crate::disk::state::Xvb { ui.add_space(space_h); + let mut is_slider_enabled = true; let mut hashrate_xmrig = { if lock!(gui_api_xmrig).hashrate_raw_15m > 0.0 { lock!(gui_api_xmrig).hashrate_raw_15m } else if lock!(gui_api_xmrig).hashrate_raw_1m > 0.0 { lock!(gui_api_xmrig).hashrate_raw_1m - } else { + } else if lock!(gui_api_xmrig).hashrate_raw { lock!(gui_api_xmrig).hashrate_raw + } else { + is_slider_enabled = false; + 1000.0 } }; @@ -187,7 +191,7 @@ impl crate::disk::state::Xvb { XVB_MANUAL_SLIDER_MANUAL_P2POOL_HELP }; - ui.add_enabled_ui(is_alive, |ui| { + ui.add_enabled_ui(is_slider_enabled, |ui| { ui.horizontal(|ui| { ui.spacing_mut().slider_width = width * 0.5; ui.add_sized( diff --git a/src/utils/constants.rs b/src/utils/constants.rs index 48fef19..37762ba 100644 --- a/src/utils/constants.rs +++ b/src/utils/constants.rs @@ -443,8 +443,8 @@ pub const XVB_ROUND_DONOR_WHALE_MIN_HR: u32 = 100000; pub const XVB_ROUND_DONOR_MEGA_MIN_HR: u32 = 1000000; // Manual Mode -pub const XVB_MODE_MANUAL_XVB_HELP: &str = "Manually set the amount to donate to XmrVsBeast, The remaining hashrate will be sent to p2pool"; -pub const XVB_MODE_MANUAL_P2POOL_HELP: &str = "Manually set the amount to keep on P2pool, The remaining hashrate will be donated to xvb"; +pub const XVB_MODE_MANUAL_XVB_HELP: &str = "Manually set the amount to donate to XmrVsBeast, If value is more than xmrig hashrate it might be changed"; +pub const XVB_MODE_MANUAL_P2POOL_HELP: &str = "Manually set the amount to keep on P2pool, If value is more than xmrig hashrate it might be changed"; pub const XVB_MODE_MANUAL_DONATION_LEVEL_HELP: &str = "Manually set the XvB donation level";