Do not allow us to edit the Note Editor if the Note cannot be saved

In some rare cases the note just doesn't get saved on disk - in those
cases instead of silently failing we will refuse to exit the note
editor, forcing the user to copy the note and paste it somewhere else in
order to not lose the date.

This isn't the best solution, but it prevents data loss, in a few edge
cases which I cannot reproduce.

Fixes #124
This commit is contained in:
Vishesh Handa
2020-07-13 17:13:02 +02:00
parent 885edbffc1
commit 84fab89f48
4 changed files with 33 additions and 8 deletions

View File

@ -58,3 +58,12 @@ NotesFolderFS getFolderForEditor(
return rootFolder.getFolderWithSpec(spec);
}
}
Future<void> showAlertDialog(
BuildContext context, String title, String message) async {
var dialog = AlertDialog(
title: Text(title),
content: Text(message),
);
return showDialog(context: context, builder: (context) => dialog);
}