Skip to content

Commit

Permalink
refactor: remove untrack for var handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rbjornstad committed Feb 13, 2025
1 parent f9c2a97 commit c6eca97
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions src/lib/components/WorkloadsWithSBOM.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import Pagination from '$lib/Pagination.svelte';
import { changeParams } from '$lib/utils/searchparams.svelte';
import { Skeleton, Table, Tbody, Td, Th, Thead, Tr } from '@nais/ds-svelte-community';
import { untrack } from 'svelte';
import type { WorkloadsWithSbomVariables } from './$houdini';
import Vulnerability from './Vulnerability.svelte';
import WorkloadLink from './WorkloadLink.svelte';
Expand All @@ -24,31 +23,29 @@
let { team, environment = $bindable() }: Props = $props();
export const _WorkloadsWithSbomVariables: WorkloadsWithSbomVariables = () => {
return untrack(() => {
const env = environment;
const field = tableSort.orderBy
? tableSort.orderBy
: WorkloadOrderField.VULNERABILITY_SEVERITY_CRITICAL;
const direction = tableSort.direction ? tableSort.direction : 'DESC';
const env = environment;
const field = tableSort.orderBy
? tableSort.orderBy
: WorkloadOrderField.VULNERABILITY_SEVERITY_CRITICAL;
const direction = tableSort.direction ? tableSort.direction : 'DESC';
if (env !== '') {
return {
team: team,
orderBy: {
field,
direction
},
filter: { environments: [env] }
};
}
if (env !== '') {
return {
team: team,
orderBy: {
field,
direction
}
},
filter: { environments: [env] }
};
});
}
return {
team: team,
orderBy: {
field,
direction
}
};
};
const query = graphql(`
Expand Down

0 comments on commit c6eca97

Please sign in to comment.