mobile frontend shows only the active tab

This commit is contained in:
zadam 2019-07-28 14:08:05 +02:00
parent 741dfaf2de
commit 263bff903c

View File

@ -196,7 +196,11 @@ async function resolveNotePath(notePath) {
async function getRunPath(notePath) {
utils.assertArguments(notePath);
notePath = notePath.split("-")[0];
notePath = notePath.split("-")[0].trim();
if (notePath.length === 0) {
return;
}
const path = notePath.split("/").reverse();
@ -362,7 +366,7 @@ async function treeInitialized() {
}
}
const filteredTabs = [];
let filteredTabs = [];
for (const openTab of openTabs) {
const noteId = treeUtils.getNoteIdFromNotePath(openTab.notePath);
@ -373,6 +377,11 @@ async function treeInitialized() {
}
}
if (utils.isMobile()) {
// mobile frontend doesn't have tabs so show only the active tab
filteredTabs = filteredTabs.filter(tab => tab.active);
}
if (filteredTabs.length === 0) {
filteredTabs.push({
notePath: 'root',