Skip to content

Commit a59cb52

Browse files
committed
minor fixes
1 parent 911290f commit a59cb52

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export default class BeastVault extends Plugin {
251251

252252
onunload() {
253253
if (this.saveTimer != null) {
254-
this.flushSave();
254+
void this.flushSave();
255255
}
256256
}
257257

@@ -264,7 +264,7 @@ export default class BeastVault extends Plugin {
264264
updateState() {
265265
// Debounce writes
266266
if (this.saveTimer != null) window.clearTimeout(this.saveTimer);
267-
this.saveTimer = window.setTimeout(() => { this.flushSave(); }, 1000);
267+
this.saveTimer = window.setTimeout(() => { void this.flushSave(); }, 1000);
268268
}
269269

270270
async flushSave() {

src/ui.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,17 @@ export class AdversaryCard extends MarkdownRenderChild {
135135
paragraph.createEl('b', { text: feature.name || '' });
136136
paragraph.createSpan({ text: feature.type && `${feature.name}` ? ' - ' : '' });
137137
paragraph.createSpan({ text: feature.type || '' });
138-
feature.type || feature.name ? paragraph.createEl('br') : '';
138+
if (feature.type || feature.name) {
139+
paragraph.createEl('br');
140+
}
139141
if (this.count == 1) {
140142
this.createStatSlots(paragraph, 'Uses', feature.uses || 0, [this.adv.id, 0, 'uses', index]);
141143
// For now, we only have countdowns in environments
142144
this.createStatSlots(paragraph, 'Countdown', feature.countdown || 0, [this.adv.id, 0, 'countdown', index]);
143145
}
144146
if (feature.desc) {
145147
const featureDiv = paragraph.createDiv({ cls: 'bv-feature' });
146-
MarkdownRenderer.render(
148+
void MarkdownRenderer.render(
147149
this.plugin.app,
148150
feature
149151
.desc
@@ -311,7 +313,7 @@ export class AdversaryCard extends MarkdownRenderChild {
311313
features.createEl('hr');
312314
}
313315

314-
for (const [index, feature] of this.adv.features!.entries()) {
316+
for (const [index, feature] of this.adv.features.entries()) {
315317
this.createFeature(features, index, feature);
316318
}
317319

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function processAdversary(obj: any, filePath: string): Adversary {
6565
obj.attack = obj.attack > 0 ? `+${obj.attack}` : `${obj.attack}`;
6666
}
6767
if (typeof obj.thresholds === "string") {
68-
obj.thresholds = obj.thresholds.split(/[,\/]/).filter((s: string) => s.trim().toLowerCase() != 'none');
68+
obj.thresholds = obj.thresholds.split(/[,/]/).filter((s: string) => s.trim().toLowerCase() != 'none');
6969
}
7070
if (typeof obj.thresholds === "number") {
7171
obj.thresholds = [obj.thresholds];

0 commit comments

Comments
 (0)