From 4a7ed4730c67a7ec4efaf3ee6eee308796204e37 Mon Sep 17 00:00:00 2001 From: pseudometa <73286100+chrisgrieser@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:56:18 +0100 Subject: [PATCH] fix: citation and footnote actually displaying --- src/status/StatusBar.ts | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/status/StatusBar.ts b/src/status/StatusBar.ts index 4e1aabb..aeee7aa 100644 --- a/src/status/StatusBar.ts +++ b/src/status/StatusBar.ts @@ -109,6 +109,46 @@ export default class StatusBar { : 0)); break; } + } else if (metric.counter === MetricCounter.footnotes) { + switch (metric.type) { + case MetricType.file: + display = display + getFootnoteCount(text); + break; + case MetricType.daily: + display = + display + + (this.plugin.settings.collectStats + ? this.plugin.statsManager.getDailyFootnotes() + : 0); + break; + case MetricType.total: + display = + display + + (await (this.plugin.settings.collectStats + ? this.plugin.statsManager.getTotalFootnotes() + : 0)); + break; + } + } else if (metric.counter === MetricCounter.citations) { + switch (metric.type) { + case MetricType.file: + display = display + getCitationCount(text); + break; + case MetricType.daily: + display = + display + + (this.plugin.settings.collectStats + ? this.plugin.statsManager.getDailyCitations() + : 0); + break; + case MetricType.total: + display = + display + + (await (this.plugin.settings.collectStats + ? this.plugin.statsManager.getTotalCitations() + : 0)); + break; + } } else if (metric.counter === MetricCounter.files) { switch (metric.type) { case MetricType.file: @@ -211,6 +251,46 @@ export default class StatusBar { : 0)); break; } + } else if (metric.counter === MetricCounter.footnotes) { + switch (metric.type) { + case MetricType.file: + display = display + 0; + break; + case MetricType.daily: + display = + display + + (this.plugin.settings.collectStats + ? this.plugin.statsManager.getDailyFootnotes() + : 0); + break; + case MetricType.total: + display = + display + + (await (this.plugin.settings.collectStats + ? this.plugin.statsManager.getTotalFootnotes() + : 0)); + break; + } + } else if (metric.counter === MetricCounter.citations) { + switch (metric.type) { + case MetricType.file: + display = display + 0; + break; + case MetricType.daily: + display = + display + + (this.plugin.settings.collectStats + ? this.plugin.statsManager.getDailyCitations() + : 0); + break; + case MetricType.total: + display = + display + + (await (this.plugin.settings.collectStats + ? this.plugin.statsManager.getTotalCitations() + : 0)); + break; + } } else if (metric.counter === MetricCounter.files) { switch (metric.type) { case MetricType.file: