This has been bugging me for a while. If you create a new file and then save it, the dialogue would show the home directory and not the folder that you were in. This fixes it. Release Notes: - N/A
Unified · Split
| @@ -314,20 +314,27 @@ impl<P: LinuxClient + 'static> Platform for P { · 313 unmodified lines | ||
| 314 | 314 | let directory = directory.to_owned(); |
| 315 | 315 | self.foreground_executor() |
| 316 | 316 | .spawn(async move { |
| 317 | − let result = SaveFileRequest::default() | |
| 317 | + let request = SaveFileRequest::default() | |
| 318 | 318 | .modal(true) |
| 319 | 319 | .title("Select new path") |
| 320 | 320 | .accept_label("Accept") |
| 321 | − .send() | |
| 322 | − .await | |
| 323 | − .ok() | |
| 324 | − .and_then(|request| request.response().ok()) | |
| 325 | − .and_then(|response| { | |
| 326 | − response | |
| 327 | − .uris() | |
| 328 | − .first() | |
| 329 | − .and_then(|uri| uri.to_file_path().ok()) | |
| 330 | − }); | |
| 321 | + .current_folder(directory); | |
| 322 | + | |
| 323 | + let result = if let Ok(request) = request { | |
| 324 | + request | |
| 325 | + .send() | |
| 326 | + .await | |
| 327 | + .ok() | |
| 328 | + .and_then(|request| request.response().ok()) | |
| 329 | + .and_then(|response| { | |
| 330 | + response | |
| 331 | + .uris() | |
| 332 | + .first() | |
| 333 | + .and_then(|uri| uri.to_file_path().ok()) | |
| 334 | + }) | |
| 335 | + } else { | |
| 336 | + None | |
| 337 | + }; | |
| 331 | 338 | |
| 332 | 339 | done_tx.send(result); |
| 333 | 340 | }) |