diff --git a/lib/app.dart b/lib/app.dart index 8047dc58..3785b671 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -71,7 +71,21 @@ class JournalApp extends StatefulWidget { Log.i("New Documents Directory Path ${dir.path}"); } - if (appState.localGitRepoConfigured == false) { + // Handle migrations - Remove this code in 2021 + var localConfigured = appState.localGitRepoConfigured; + if (localConfigured && appState.remoteGitRepoConfigured == false) { + appState.localGitRepoFolderName = "journal_local"; + var repoPath = p.join( + appState.gitBaseDirectory, + appState.localGitRepoFolderName, + ); + + if (!Directory(repoPath).existsSync()) { + localConfigured = false; + } + } + + if (localConfigured == false) { // FIXME: What about exceptions! appState.localGitRepoFolderName = "journal_local"; var repoPath = p.join(