From 8e5cb1c104e0d31dc474a97c73d16b6562a62ba2 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:10:09 +0800 Subject: [PATCH] fix: outline view display bug when no h1 fix: #959 --- addon/chrome/content/treeView.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addon/chrome/content/treeView.html b/addon/chrome/content/treeView.html index e9b1cbe..51b5e50 100644 --- a/addon/chrome/content/treeView.html +++ b/addon/chrome/content/treeView.html @@ -361,7 +361,7 @@ cachedNodes = nodes; console.log(expandedStatus); const treeData = []; - nodes.map((node) => { + nodes.forEach((node) => { treeData.push({ id: String(node.model.id), name: node.model.name, @@ -375,7 +375,9 @@ ? expandedStatus[node.model.name] : node.model.level < expandLevel, parentId: - node.model.level > 1 ? String(node.parent.model.id) : undefined, + node.parent.model.id > 0 + ? String(node.parent.model.id) + : undefined, }); }); $(() => {