web: make random emoji selection more deterministic
This commit is contained in:
parent
c1496bf87b
commit
38e75ec251
@ -341,9 +341,10 @@ fn search_results(
|
||||
let caught_up = query.contains("is:unread");
|
||||
let read_emoji = ["👻", "👽", "👾", "🤖", "💀"];
|
||||
let no_results_emoji = ["🙈", "👀", "🤦", "🤷", "🙅", "🛟", "🍩", "🌑", "💿", "🔍"];
|
||||
// Randomly choose emoji based on what 10-second window we're currently in
|
||||
let now = seed::window()
|
||||
.performance()
|
||||
.map(|p| p.now() as usize)
|
||||
.map(|p| p.now() as usize / 10_000)
|
||||
.unwrap_or(0);
|
||||
let (emoji, text) = if caught_up {
|
||||
let idx = now % read_emoji.len();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user