Fix opening on relative notes when clicking on a link

This commit is contained in:
Vishesh Handa
2020-06-19 12:39:43 +02:00
parent ea04ae3598
commit 3be7a7d350

View File

@ -63,9 +63,9 @@ class NoteViewer extends StatelessWidget {
onTapLink: (String link) {
if (link.startsWith('./')) {
var spec = link.substring(2);
var note = rootFolder.getNoteWithSpec(spec);
if (note != null) {
openNoteEditor(context, note);
var linkedNote = note.parent.getNoteWithSpec(spec);
if (linkedNote != null) {
openNoteEditor(context, linkedNote);
} else {
showSnackbar(context, "Link '$link' not found");
}