Skip to content

Commit

Permalink
Fix some type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Oct 31, 2024
1 parent 1959710 commit 4585efa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/module/roll-table/oracle-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,10 @@ export class OracleTable extends RollTable {
// Draw from the cursed table
const cursedResult = cursedTable.results.find(
(x) =>
originalRoll.total >= x.range[0] && originalRoll.total <= x.range[1]
(originalRoll.total ?? -1) >= x.range[0] &&
(originalRoll.total ?? -1) <= x.range[1]
)
return { cursedResults: [cursedResult], cursedDie }
return { cursedResults: compact([cursedResult]), cursedDie }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/module/vue/sf-truths.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
ref="categoryComponents"
:key="(truth.je()._id as string)"
:je="truth.je"
v-model="categoryModels[truth.je()._id]"
v-model="categoryModels[truth.je()._id ?? '']"
/>
</section>
</div>
Expand Down Expand Up @@ -75,7 +75,7 @@ async function saveTruths() {
// Fetch values from the category components
const contentSections: string[] = []
for (const t of props.data.truths) {
const model = categoryModels.value[t.je()._id]
const model = categoryModels.value[t.je()._id ?? '']
if (model.valid)
contentSections.push(
`<h2>${model.title}</h2>
Expand Down

0 comments on commit 4585efa

Please sign in to comment.