Skip to content

Commit

Permalink
Only load scan results if a scan ran
Browse files Browse the repository at this point in the history
`getLatestOnerepScan` either returns `null` or a scan, so a check
for !== "undefined" will always be true.

In practice, that should have the same results, since fetching
scan results should still return an empty array, but not running
the query in the first place is more efficient.
  • Loading branch information
Vinnl committed Sep 11, 2024
1 parent bd762fb commit 731d1aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/db/tables/onerep_scans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ async function getLatestOnerepScanResults(

let results: OnerepScanResultRow[] = [];

if (typeof scan !== "undefined") {
if (scan !== null) {
const qaToggles = await getQaToggleRow(onerepProfileId);
let showCustomBrokers = false;
let showRealBrokers = true;
Expand Down

0 comments on commit 731d1aa

Please sign in to comment.