fix: do not take write lock for maybe_network_lost() and set_push_device_token()

This commit is contained in:
link2xt
2024-10-25 20:49:49 +00:00
parent 69b4c0ccb4
commit 51a1762228
3 changed files with 4 additions and 4 deletions

View File

@@ -344,7 +344,7 @@ impl Accounts {
}
/// Sets notification token for Apple Push Notification service.
pub async fn set_push_device_token(&mut self, token: &str) -> Result<()> {
pub async fn set_push_device_token(&self, token: &str) -> Result<()> {
self.push_subscriber.set_device_token(token).await;
Ok(())
}

View File

@@ -31,7 +31,7 @@ impl PushSubscriber {
}
/// Sets device token for Apple Push Notification service.
pub(crate) async fn set_device_token(&mut self, token: &str) {
pub(crate) async fn set_device_token(&self, token: &str) {
self.inner.write().await.device_token = Some(token.to_string());
}