Skip to content

Commit

Permalink
⚡ [ecl] improve performance of mission and patient timers #3046
Browse files Browse the repository at this point in the history
  • Loading branch information
jxn-30 committed May 31, 2024
1 parent e38bd80 commit 9b26930
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"unicorn/prefer-native-coercion-functions": ["error"],
"unicorn/prefer-negative-index": ["error"],
"unicorn/prefer-object-from-entries": ["error"],
"unicorn/prefer-query-selector": ["error"],
"unicorn/prefer-query-selector": ["off"],
"unicorn/switch-case-braces": ["error", "avoid"],
"vue/no-unused-refs": "warn",
"vue/prefer-true-attribute-shorthand": "warn",
Expand Down
4 changes: 2 additions & 2 deletions src/modules/extendedCallList/assets/remainingPatientTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export default (LSSM: Vue): void =>
event: 'patientTimer',
callback() {
window.patient_timers.forEach(patient => {
const bar = document.querySelector<HTMLDivElement>(
`#patient_bar_${patient.patient_id}`
const bar = document.getElementById(
`patient_bar_${patient.patient_id}`
);
const barOuter = bar?.parentElement;
if (!bar || !barOuter || patient.params.target_percent) return;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/extendedCallList/assets/remainingTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default (LSSM: Vue, greenOnly: boolean): void =>
event: 'missionTimer',
callback({ date_end_calc, id, vehicle_state }: MissionTimer) {
if (greenOnly && vehicle_state !== 2) return;
const timeElement = document.querySelector<HTMLDivElement>(
`#mission_overview_countdown_${id}`
const timeElement = document.getElementById(
`mission_overview_countdown_${id}`
);
if (timeElement) {
timeElement.textContent = window.formatTime(
Expand Down

0 comments on commit 9b26930

Please sign in to comment.