diff --git a/src/components/CaptureDetailDialog.js b/src/components/CaptureDetailDialog.js
index 28b5b81bc..0cb0dfc3b 100644
--- a/src/components/CaptureDetailDialog.js
+++ b/src/components/CaptureDetailDialog.js
@@ -11,6 +11,7 @@ import {
Drawer,
Box,
Link,
+ CircularProgress,
} from '@material-ui/core';
import Close from '@material-ui/icons/Close';
import OptimizedImage from './OptimizedImage';
@@ -82,6 +83,9 @@ const useStyles = makeStyles((theme) => ({
itemValue: {
lineHeight: 1.7,
},
+ spinner: {
+ position: 'fixed',
+ },
}));
function CaptureDetailDialog(props) {
@@ -91,6 +95,7 @@ function CaptureDetailDialog(props) {
const [snackbarLabel, setSnackbarLabel] = useState('');
const [renderCapture, setRenderCapture] = useState(null);
const [isLoading, setIsLoading] = useState(true);
+ const [isImageLoading, setIsImageLoading] = useState(true);
const classes = useStyles();
// This is causing unnecessary re-renders right now, but may be useful if we want to navigate between captures by id
@@ -139,6 +144,7 @@ function CaptureDetailDialog(props) {
if (isLoading) {
setIsLoading(false);
}
+ setIsImageLoading(true);
}, [cdContext.capture]);
useEffect(() => {
@@ -356,13 +362,26 @@ function CaptureDetailDialog(props) {
}}
maxWidth="md"
>
-
+ {isLoading ? (
+
+ ) : (
+ <>
+ {isImageLoading && (
+
+ )}
+
+ {
+ setIsImageLoading(false);
+ }}
+ />
+ >
+ )}
{
+ onImageReady && onImageReady();
+ }}
style={{
position: 'absolute',
left: 0,