mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 17:29:50 +08:00
RemoveExistingClone if onboarding is not completed
This only happens when I manually delete the shared_prefs. It's basically a way to make working on the onboarding much easier.
This commit is contained in:
@ -62,6 +62,18 @@ class StateContainerState extends State<StateContainer> {
|
||||
if (appState.onBoardingCompleted) {
|
||||
_loadNotesFromDisk();
|
||||
_syncNotes();
|
||||
} else {
|
||||
_removeExistingClone();
|
||||
}
|
||||
}
|
||||
|
||||
void _removeExistingClone() async {
|
||||
var baseDir = await getNotesDir();
|
||||
var dotGitDir = new Directory(p.join(baseDir.path, ".git"));
|
||||
bool exists = await dotGitDir.exists();
|
||||
if (exists) {
|
||||
await baseDir.delete(recursive: true);
|
||||
await baseDir.create();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user