aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client/src/record
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-05-21 10:43:08 +0700
committerGitHub <noreply@github.com>2024-05-21 10:43:08 +0700
commit8dc8448de0b9acaf9c3c27556d3c6c4342d8d493 (patch)
treea0fc95ebb1bf2fd2f923ac54634c8c021d93e476 /crates/atuin-client/src/record
parentchore(deps): bump tokio from 1.36.0 to 1.37.0 (#2033) (diff)
downloadatuin-8dc8448de0b9acaf9c3c27556d3c6c4342d8d493.zip
fix(daemon): do not try to sync if logged out (#2037)
* fix(daemon): do not try to sync if logged out I've also added Settings::logged_in, as there are a few places where we switch on login state. * make session_token a function
Diffstat (limited to 'crates/atuin-client/src/record')
-rw-r--r--crates/atuin-client/src/record/sync.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/atuin-client/src/record/sync.rs b/crates/atuin-client/src/record/sync.rs
index 234c6442..c3794b59 100644
--- a/crates/atuin-client/src/record/sync.rs
+++ b/crates/atuin-client/src/record/sync.rs
@@ -55,7 +55,10 @@ pub async fn diff(
) -> Result<(Vec<Diff>, RecordStatus), SyncError> {
let client = Client::new(
&settings.sync_address,
- &settings.session_token,
+ settings
+ .session_token()
+ .map_err(|e| SyncError::RemoteRequestError { msg: e.to_string() })?
+ .as_str(),
settings.network_connect_timeout,
settings.network_timeout,
)
@@ -270,7 +273,10 @@ pub async fn sync_remote(
) -> Result<(i64, Vec<RecordId>), SyncError> {
let client = Client::new(
&settings.sync_address,
- &settings.session_token,
+ settings
+ .session_token()
+ .map_err(|e| SyncError::RemoteRequestError { msg: e.to_string() })?
+ .as_str(),
settings.network_connect_timeout,
settings.network_timeout,
)