fix: citation and footnote actually displaying

This commit is contained in:
pseudometa 2023-02-17 13:56:18 +01:00
parent 3412745204
commit 4a7ed4730c

View file

@ -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: