From e82f54203ccdb9f2b9689e01ad9a576cad158a68 Mon Sep 17 00:00:00 2001 From: DMT Date: Tue, 5 Dec 2023 20:25:11 -0800 Subject: [PATCH] don't start loading data until channel state set up --- src/aics-image-viewer/components/App/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/aics-image-viewer/components/App/index.tsx b/src/aics-image-viewer/components/App/index.tsx index 5145abac..a39623f1 100644 --- a/src/aics-image-viewer/components/App/index.tsx +++ b/src/aics-image-viewer/components/App/index.tsx @@ -446,13 +446,14 @@ const App: React.FC = (props) => { const thisChannelSettings = getOneChannelSetting(v.imageInfo.channelNames[channelIndex]); onChannelDataLoaded(v, thisChannelSettings!, channelIndex, samePath); }); - loader.loadVolumeData(aimg); const channelNames = aimg.imageInfo.channelNames; const newChannelSettings = setChannelStateForNewImage(channelNames); - setAllChannelsUnloaded(channelNames.length); + // now that channel state is ready, we can initiate the first data load + loader.loadVolumeData(aimg); + imageUrlRef.current = fullUrl; placeImageInViewer(aimg, newChannelSettings); };