Fix main & improve cursor sync (#101)
This commit is contained in:
parent
81b81e30ff
commit
a36a24effc
1 changed files with 913 additions and 673 deletions
|
|
@ -47,7 +47,7 @@ impl Cursors {
|
|||
all_device_cursors.retain(|c| &c.client_cursors.device_id != device_id);
|
||||
all_device_cursors.push(ClientCursorsWithTimeToLive::new(ClientCursors {
|
||||
user_name,
|
||||
device_id: device_id.to_string(),
|
||||
device_id: device_id.clone(),
|
||||
documents_with_cursors: document_to_cursors,
|
||||
}));
|
||||
|
||||
|
|
@ -126,5 +126,7 @@ impl ClientCursorsWithTimeToLive {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_expired(&self, ttl: Duration) -> bool { self.last_updated.elapsed() > ttl }
|
||||
pub fn is_expired(&self, ttl: Duration) -> bool {
|
||||
self.last_updated.elapsed() > ttl
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue