Skip to content

Commit

Permalink
fixed draft indicator on preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
symunona committed Nov 23, 2023
1 parent ac80280 commit f2c06ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ui/render-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ export class ExportTableRender {
const metadataWrapper = createSpan({ cls: 'metadata' })

if (this.settings.isPublishedField) {
const draftsInFolder = this.countDraftsInFolder(list)
const publishedInFolder = allInFolder - draftsInFolder;
if (draftsInFolder > 0) {
metadataWrapper.title = 'Published / Draft = ' + allInFolder;
const publishedInFolder = this.publishedInFolder(list)
const draftsInFolder = allInFolder - publishedInFolder;
if (publishedInFolder > 0) {
metadataWrapper.title = 'Published / Draft SUM = ' + allInFolder;
metadataWrapper.createSpan({
text: String(publishedInFolder),
cls: 'metadata-published',
Expand All @@ -247,7 +247,7 @@ export class ExportTableRender {
return metadataWrapper
}

countDraftsInFolder(list: ExportProperties[]): number {
publishedInFolder(list: ExportProperties[]): number {
return list.filter((e) => {
return Boolean(e.frontMatter[this.settings.isPublishedField])
}).length
Expand Down

0 comments on commit f2c06ac

Please sign in to comment.