mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 19:36:25 +08:00
Fix the case when the repo folder disappears
In that case we should treat it as though the app is being freshly launched. Fixes APP-43
This commit is contained in:
15
lib/app.dart
15
lib/app.dart
@ -71,6 +71,21 @@ class JournalApp extends StatefulWidget {
|
|||||||
Log.i("New Documents Directory Path ${dir.path}");
|
Log.i("New Documents Directory Path ${dir.path}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appState.remoteGitRepoConfigured) {
|
||||||
|
var gitBaseDir = appState.gitBaseDirectory;
|
||||||
|
// Something major has gone wrong.
|
||||||
|
var repoFolder = p.join(gitBaseDir, appState.remoteGitRepoFolderName);
|
||||||
|
if (!File(repoFolder).existsSync()) {
|
||||||
|
// Reset the state
|
||||||
|
appState.remoteGitRepoConfigured = false;
|
||||||
|
appState.localGitRepoConfigured = false;
|
||||||
|
|
||||||
|
// Local Folder
|
||||||
|
var localRepoDir = p.join(gitBaseDir, appState.localGitRepoFolderName);
|
||||||
|
await Directory(localRepoDir).delete(recursive: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle migrations - Remove this code in 2021
|
// Handle migrations - Remove this code in 2021
|
||||||
var localConfigured = appState.localGitRepoConfigured;
|
var localConfigured = appState.localGitRepoConfigured;
|
||||||
if (localConfigured && appState.remoteGitRepoConfigured == false) {
|
if (localConfigured && appState.remoteGitRepoConfigured == false) {
|
||||||
|
Reference in New Issue
Block a user