From c4669cbaa385a1ac8779d5cac185c4f03f138c53 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 1 Jun 2019 20:32:11 +0200 Subject: [PATCH] fallback to display empty tab if the requested note doesn't exist anymore --- src/public/javascripts/services/note_detail.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index 3c0d91dcc..be198d30f 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -232,6 +232,12 @@ async function loadNoteDetail(origNotePath, options = {}) { if (!notePath) { console.error(`Cannot resolve note path ${origNotePath}`); + + // fallback to display something + if (tabContexts.length === 0) { + await openEmptyTab(); + } + return; }