Skip to content

Commit

Permalink
another off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
stonedDiscord committed Aug 8, 2024
1 parent db70f10 commit c84c135
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webAO/dom/pickEvidence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getIndexFromSelect } from './getIndexFromSelect'
export function pickEvidence(evidence: number) {
if (client.selectedEvidence !== evidence) {
// Update selected evidence
if (client.selectedEvidence > 0) {
if (client.selectedEvidence >= 0) {
document.getElementById(`evi_${client.selectedEvidence}`)!.className =
"evi_icon";
}
Expand All @@ -19,20 +19,20 @@ export function pickEvidence(evidence: number) {

// Show evidence on information window
(<HTMLInputElement>document.getElementById("evi_name")).value =
client.evidences[evidence - 1].name;
client.evidences[evidence].name;
(<HTMLInputElement>document.getElementById("evi_desc")).value =
client.evidences[evidence - 1].desc;
client.evidences[evidence].desc;

// Update icon
const icon_id = getIndexFromSelect(
"evi_select",
client.evidences[evidence - 1].filename
client.evidences[evidence].filename
);
(<HTMLSelectElement>document.getElementById("evi_select")).selectedIndex =
icon_id;
if (icon_id === 0) {
(<HTMLInputElement>document.getElementById("evi_filename")).value =
client.evidences[evidence - 1].filename;
client.evidences[evidence].filename;
}
updateEvidenceIcon();

Expand Down

0 comments on commit c84c135

Please sign in to comment.