From 01e69d2bd42d9fc6d4a32a9b147092bc1de26230 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 31 Jan 2023 20:45:38 -0800 Subject: [PATCH] Use PWD for current download directory on desktop if the defaults do not exist --- lib/cwtch/ffi.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index 60a6bb25..1dc2483f 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -782,10 +782,11 @@ class CwtchFfi implements Cwtch { @override String? defaultDownloadPath() { + Map envVars = Platform.environment; String nominalPath = path.join(envVars[Platform.isWindows ? 'UserProfile' : 'HOME']!, "Downloads"); if (Directory(nominalPath).existsSync() == false) { - return null; + return Directory.current.path; } return nominalPath; }