bug with index out-of-range in widget fixed with help of lowest common multiple, thanks to @ogenkidu and @metanomad
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
f9233c6291
commit
6347474633
@ -11,4 +11,4 @@ pub use big_text::BigText;
|
||||
pub use big_text::PixelSize;
|
||||
pub use input::{Input, InputRequest};
|
||||
|
||||
const CYCLE: i64 = 1500;
|
||||
const CYCLE: i64 = 1560;
|
||||
|
@ -14,8 +14,6 @@ impl Default for VerticalBlocks {
|
||||
|
||||
impl ToString for VerticalBlocks {
|
||||
fn to_string(&self) -> String {
|
||||
// TODO: how it can be equal to len()??
|
||||
// do we really need super::CYCLE in denominator?
|
||||
self.elements[((chrono::Utc::now().timestamp_millis() % super::CYCLE)
|
||||
/ (super::CYCLE / self.elements.len() as i64)) as usize]
|
||||
.to_owned()
|
||||
|
Loading…
Reference in New Issue
Block a user