Skip to content

Commit d44b1dc

Browse files
committed
🔨 chore: format
1 parent dab365f commit d44b1dc

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

apps/desktop/src/api/commands.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,25 +245,39 @@ pub async fn auth_login(handle: AppHandle) -> Result<Option<MinecraftCredentials
245245
let win = tauri::WebviewWindowBuilder::new(
246246
&handle,
247247
"login",
248-
tauri::WebviewUrl::External(flow.redirect_uri.parse().map_err(|_|
249-
anyhow::anyhow!("failed to parse auth redirect url")
250-
).map_err(|err| err.to_string())?),
248+
tauri::WebviewUrl::External(
249+
flow.redirect_uri
250+
.parse()
251+
.map_err(|_| anyhow::anyhow!("failed to parse auth redirect url"))
252+
.map_err(|err| err.to_string())?,
253+
),
251254
)
252255
.title("Log into OneLauncher")
253256
.always_on_top(true)
254257
.center()
255258
.build()
256259
.map_err(|err| err.to_string())?;
257260

258-
win.request_user_attention(Some(tauri::UserAttentionType::Critical)).map_err(|err| err.to_string())?;
261+
win.request_user_attention(Some(tauri::UserAttentionType::Critical))
262+
.map_err(|err| err.to_string())?;
259263

260264
while (chrono::Utc::now() - now) < chrono::Duration::minutes(10) {
261265
if win.title().is_err() {
262266
return Ok(None);
263267
}
264268

265-
if win.url().map_err(|err| err.to_string())?.as_str().starts_with("https://login.live.com/oauth20_desktop.srf") {
266-
if let Some((_, code)) = win.url().map_err(|err| err.to_string())?.query_pairs().find(|x| x.0 == "code") {
269+
if win
270+
.url()
271+
.map_err(|err| err.to_string())?
272+
.as_str()
273+
.starts_with("https://login.live.com/oauth20_desktop.srf")
274+
{
275+
if let Some((_, code)) = win
276+
.url()
277+
.map_err(|err| err.to_string())?
278+
.query_pairs()
279+
.find(|x| x.0 == "code")
280+
{
267281
win.close().map_err(|err| err.to_string())?;
268282
let value = minecraft::finish(&code.clone(), flow).await?;
269283

packages/core/src/api/settings.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ pub async fn set_directory(new: PathBuf) -> crate::Result<()> {
167167

168168
tracing::trace!("re-resetting file watching system");
169169
let mut file_watcher = crate::utils::watcher::initialize_watcher().await?;
170-
state_write.clusters = RwLock::new(Clusters::initialize(&state_write.directories, &mut file_watcher).await?);
170+
state_write.clusters =
171+
RwLock::new(Clusters::initialize(&state_write.directories, &mut file_watcher).await?);
171172
state_write.watcher = RwLock::new(file_watcher);
172173
send_ingress(&ingress, 10.0, None).await?;
173174

packages/core/src/store/minecraft.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,5 +1034,5 @@ pub enum MinecraftAuthError {
10341034
#[error("failed to read user hash")]
10351035
HashError,
10361036
#[error("failed to read user xbox session ID")]
1037-
SessionIdError
1037+
SessionIdError,
10381038
}

packages/core/src/store/processor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ impl Processor {
582582
if let Err(err) = cluster::edit(&cluster_path, |cluster| {
583583
cluster.meta.recently_played += update as u64;
584584
async { Ok(()) }
585-
}).await {
585+
})
586+
.await
587+
{
586588
tracing::warn!(
587589
"failed to update playtime for cluster {}: {}",
588590
&cluster_path,

0 commit comments

Comments
 (0)