mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
fix: only use new directory in the failure case
since other builds could have worked and have already wallet files in the documents folder
This commit is contained in:
parent
678e402633
commit
f16a86cdfe
1 changed files with 9 additions and 2 deletions
|
@ -13,7 +13,15 @@ Future<Directory> getAppDir({String appName = 'cake_wallet'}) async {
|
|||
dir.create(recursive: true);
|
||||
} else {
|
||||
if (Platform.isLinux) {
|
||||
final appDirPath = '/home/${Platform.environment['USER']}/.$appName';
|
||||
String appDirPath;
|
||||
|
||||
try {
|
||||
dir = await getApplicationDocumentsDirectory();
|
||||
appDirPath = '${dir.path}/$appName';
|
||||
} catch (e) {
|
||||
appDirPath = '/home/${Platform.environment['USER']}/.$appName';
|
||||
}
|
||||
|
||||
dir = Directory.fromUri(Uri.file(appDirPath));
|
||||
await dir.create(recursive: true);
|
||||
} else {
|
||||
|
@ -23,4 +31,3 @@ Future<Directory> getAppDir({String appName = 'cake_wallet'}) async {
|
|||
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue