From ea65e27732be73f0fb57d9410ae75b7f1d457cd1 Mon Sep 17 00:00:00 2001 From: FlorianWoelki Date: Thu, 21 Oct 2021 09:26:14 +0200 Subject: [PATCH] fix: issue with giving icon a file (#9) --- src/util.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util.ts b/src/util.ts index 933e24e9..bdec6e96 100644 --- a/src/util.ts +++ b/src/util.ts @@ -113,10 +113,14 @@ export const addToDOM = (path: string, iconId: string): void => { return; } - const titleNode = node.querySelector('.nav-folder-title-content'); + let titleNode = node.querySelector('.nav-folder-title-content'); if (!titleNode) { - console.error('element with title not found'); - return; + titleNode = node.querySelector('.nav-file-title-content'); + + if (!titleNode) { + console.error('element with title not found'); + return; + } } const iconNode = document.createElement('div');