Skip to content

Commit

Permalink
Merge pull request #1560 from phac-nml/fix-analysis-text-preview
Browse files Browse the repository at this point in the history
Fix: Analysis Text Output Preview
  • Loading branch information
joshsadam authored Dec 17, 2024
2 parents 955eb44 + dd9a294 commit fbdd728
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function AnalysisTextPreview({ output }) {
const [savedText, setSavedText] = useState("");
const chunkSize = 8192;
const [loading, setLoading] = useState(false);
const [fileSizePreview,setFileSizePreview] = useState("");

/*
* Get n bytes of text file output data on load and set
Expand All @@ -48,9 +49,7 @@ export default function AnalysisTextPreview({ output }) {
setSavedText(data.text);
setFilePointer(data.filePointer);
setFileRows(data.text);
document.getElementById(
`${output.filename}-preview-status`
).innerText = fileSizeLoaded(data.filePointer, output.fileSizeBytes);
setFileSizePreview(fileSizeLoaded(data.filePointer, output.fileSizeBytes))
setLoading(false);
});
}, []);
Expand Down Expand Up @@ -81,9 +80,7 @@ export default function AnalysisTextPreview({ output }) {
setSavedText(savedText + data.text);
setFilePointer(data.filePointer);
setFileRows(savedText + data.text);
document.getElementById(
`${output.filename}-preview-status`
).innerText = fileSizeLoaded(data.filePointer, output.fileSizeBytes);
setFileSizePreview(fileSizeLoaded(data.filePointer, output.fileSizeBytes));
}
setLoading(false);
});
Expand All @@ -108,7 +105,7 @@ export default function AnalysisTextPreview({ output }) {
</TextOutputWrapper>
<div>
<Space direction={"horizontal"}>
<span id={`${output.filename}-preview-status`}></span>
<span id={`${output.filename}-preview-status`}>{fileSizePreview}</span>
<span id={`${output.filename}-loading`}>
{loading ? (
<ContentLoading
Expand Down

0 comments on commit fbdd728

Please sign in to comment.