Skip to content

Commit

Permalink
Fix sound-browser (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Jan 2, 2023
1 parent de7776c commit 8d7f966
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/sound-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export default class SoundBrowser {

let trees = soundFolders
.map(folder => {
let tree = dirTree(folder, { extensions: /\.(wav|aiff)/, exclude: /.git/ })
let tree = dirTree(folder, {
extensions: /\.(wav|aiff)/,
exclude: /.git/,
attributes: ['type']
})
if (!tree) {
atom.notifications.addError(`Sound browser: the path ${folder} is invalid`)
}
Expand All @@ -44,7 +48,7 @@ export default class SoundBrowser {

rootElement.appendChild(element)

if (tree.children.length > 0) {
if (tree.type === 'directory') {
element.textContent = tree.name
element.classList.add('icon', 'icon-open')

Expand Down

0 comments on commit 8d7f966

Please sign in to comment.