Skip to content

Commit

Permalink
Simplify logic for getting the file format
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed Nov 2, 2024
1 parent d479eba commit baa9e3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions packages/html-report/src/components/Dialogs/FileDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,7 @@ interface Props {
let { file }: Props = $props();
const input = $derived( window.SONDA_JSON_REPORT.inputs[ file.path ] );
const format = $derived.by( () => {
if ( input ) {
return input.format.toUpperCase();
}
const parent = window.SONDA_JSON_REPORT.inputs[ file.path ]?.belongsTo;
if ( !parent ) {
return 'UNKNOWN';
}
return window.SONDA_JSON_REPORT.inputs[ parent ].format.toUpperCase;
} );
const format = $derived( input?.format.toUpperCase() ?? 'UNKNOWN' );
function getImporters(
key: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/html-report/src/stores/index.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compressionStore, type CompressionStore } from './compression.svelte.js';
import { dialogsStore, type OpenedDialogsStore } from './dialogs.svelte.js';
import { activeOutputStore, type ActiveOutputStore } from './outputs.svelte.js';
import { activeOutputStore, type ActiveOutputStore } from './outputs.svelte.js';

export { duplicates } from './dependencies.js';
export { outputs } from './outputs.svelte.js';
Expand Down

0 comments on commit baa9e3c

Please sign in to comment.