Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Fix issue where files list heading was rerendered each time you open …
Browse files Browse the repository at this point in the history
…a folder
  • Loading branch information
taravancil committed May 26, 2017
1 parent e2eee2f commit 329420c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/builtin-pages/com/files-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ import {niceDate} from '../../lib/time'
// exported api
// =

export default function rFilesList (archiveInfo) {
export default function render (archiveInfo) {
return yo`
<div>
${rFolder(archiveInfo)}
${rFilesList(archiveInfo)}
</div>
`
}

function rFilesList (archiveInfo) {
if (!archiveInfo || !archiveInfo.fileTree.rootNode) {
return yo`
<div>
${rFolder(archiveInfo)}
<div class="files-list"></div>
</div>
`
Expand All @@ -18,7 +26,6 @@ export default function rFilesList (archiveInfo) {
var hasFiles = Object.keys(archiveInfo.fileTree.rootNode.children).length > 0
return yo`
<div>
${rFolder(archiveInfo)}
<div class="files-list">
${!hasFiles ? yo`<div class="item"><em>Empty folder</em></div>` : ''}
${rChildren(archiveInfo, archiveInfo.fileTree.rootNode.children)}
Expand Down

0 comments on commit 329420c

Please sign in to comment.