Fix idle changed duration

This commit is contained in:
Demmie 2024-05-16 22:21:39 -04:00
parent 0434aa103b
commit f001121d69
No known key found for this signature in database
GPG Key ID: B06DAA3D432C6E9A

View File

@ -69,7 +69,11 @@ impl State {
self.send_ping(now, client).await
}
async fn send_ping(&mut self, now: DateTime<Utc>, client: &Arc<ReportClient>) -> anyhow::Result<()> {
async fn send_ping(
&mut self,
now: DateTime<Utc>,
client: &Arc<ReportClient>,
) -> anyhow::Result<()> {
if self.is_changed {
let result = if self.is_idle {
debug!("Reporting as changed to idle");
@ -82,7 +86,7 @@ impl State {
.ping(
true,
self.last_input_time + Duration::milliseconds(1),
Duration::zero(),
now - self.last_input_time,
)
.await
} else {