Skip to content

Commit

Permalink
Fix image blob data not refreshing on Search
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalada committed Aug 5, 2024
1 parent 4935e43 commit dd2a7a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/src/components/MediaList/ImageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ const ImageBox = ({
const { format, blob_uri } = data;
const [isImageFullViewPopupOpened, setIsImageFullViewPopupOpened] =
React.useState<boolean>(false);
let [blobData, setBlobData] = React.useState<string>(
const [blobData, setBlobData] = React.useState<string>(
blobsURIModel.getState()[blob_uri] ?? null,
);

React.useEffect(() => {
let timeoutID: number;
let subscription: any;

if (blobData === null) {
if (!blobData) {
// Get the formatted URI containing the run hash and experiment id
const formattedUri = data.run.props.experiment.artifact_location
? `${data.run.props.experiment.artifact_location}/${data.run.hash}/artifacts/${blob_uri}`
Expand Down
2 changes: 2 additions & 0 deletions src/src/components/MediaPanel/MediaPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ function MediaPanel({
if (blobUriArray.current.includes(blobUrl)) {
return;
}
/* jescalada: removing this refreshes the image when clicking Search
if (processedBlobUriArray.current.includes(blobUrl)) {
return;
}
*/

blobUriArray.current.push(blobUrl);
getBatch();
Expand Down
2 changes: 0 additions & 2 deletions src/src/components/RangePanel/RangePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ function RangePanel({
>
<div className='RangePanelContainer'>
{items?.map((item) => {
console.log('RangePanel -> item', item);
const rangeLength = _.range(
item.rangeEndpoints?.[0] ?? 0,
(item.rangeEndpoints?.[1] ?? 0) + 2,
).length;
console.log('RangePanel -> rangeLength', rangeLength);
return (
<React.Fragment key={item.sliderName}>
{item.rangeEndpoints?.[0] !== item.rangeEndpoints?.[1] ? (
Expand Down

0 comments on commit dd2a7a5

Please sign in to comment.