mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 11:33:34 +08:00
Handle case where documents path changes
It seems sometimes when an app is updated their documents path changes. So our cached version of it is now incorrect and needs to be refreshed - Fixes #159
This commit is contained in:
@ -59,6 +59,14 @@ class JournalApp extends StatefulWidget {
|
||||
appState.save(pref);
|
||||
}
|
||||
|
||||
if (!Directory(appState.gitBaseDirectory).existsSync()) {
|
||||
Log.w("Applications Documents Directory no longer exists");
|
||||
var dir = await getApplicationDocumentsDirectory();
|
||||
appState.gitBaseDirectory = dir.path;
|
||||
appState.save(pref);
|
||||
Log.i("New Documents Directory Path ${dir.path}");
|
||||
}
|
||||
|
||||
if (appState.localGitRepoConfigured == false) {
|
||||
// FIXME: What about exceptions!
|
||||
appState.localGitRepoFolderName = "journal_local";
|
||||
|
@ -55,6 +55,7 @@ class AppState {
|
||||
Log.i("localGitRepoFolderName: $localGitRepoFolderName");
|
||||
Log.i("remoteGitRepoFolderName: $remoteGitRepoFolderName");
|
||||
Log.i("onBoardingCompleted: $onBoardingCompleted");
|
||||
Log.i("gitBaseDirectory: $gitBaseDirectory");
|
||||
Log.i(" ------------------ ");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user