Skip to content

Commit

Permalink
Fast exit for empty paths in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Jul 24, 2024
1 parent 7b7eb1d commit a8ca670
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/frontend/configuration/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ use std::path::PathBuf;
use tokio::task;

pub(super) async fn is_directory_writable(path: PathBuf) -> bool {
if path == PathBuf::new() {
return false;
}

task::spawn_blocking(move || {
if path.exists() {
// Try to create a temporary file to check if path is writable
Expand Down

0 comments on commit a8ca670

Please sign in to comment.