Note Rename: Do not let it be renamed to a non markdown file

Otherwise it disappears from the listing as we only show files which end
with a '.md'.
This commit is contained in:
Vishesh Handa
2020-01-27 23:11:42 +01:00
parent f8e7773f16
commit 8c5720c34b

View File

@ -151,6 +151,11 @@ class StateContainerState extends State<StateContainer> {
}
void renameNote(Note note, String newFileName) async {
// Do not let the user rename it to a non-markdown file
if (!newFileName.toLowerCase().endsWith('.md')) {
newFileName += '.md';
}
var oldNotePath = note.filePath;
note.rename(newFileName);