Skip to content

Commit 3219d99

Browse files
committed
fix(sync): add default protocol for remote space image
1 parent a3969bf commit 3219d99

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/space/SyncVisualScreen.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import {
5151
DIFF_STYLES,
5252
SYNC_PHASE_PROPERTIES,
5353
SYNC_ITEM_PROPERTIES,
54+
DEFAULT_PROTOCOL,
5455
} from '../../config/constants';
5556
import {
5657
diffString,
@@ -247,6 +248,13 @@ class SyncScreen extends Component {
247248

248249
// compare images using thumbnail url
249250
const change = diffString(localThumbnailUrl, remoteThumbnailUrl);
251+
252+
// append default protocol to display image
253+
let fullRemoteThumbnailUrl = remoteThumbnailUrl;
254+
if (fullRemoteThumbnailUrl.startsWith('//')) {
255+
fullRemoteThumbnailUrl = `${DEFAULT_PROTOCOL}:${fullRemoteThumbnailUrl}`;
256+
}
257+
250258
return (
251259
<>
252260
<Grid
@@ -274,11 +282,11 @@ class SyncScreen extends Component {
274282
})}
275283
xs={6}
276284
>
277-
{remoteThumbnailUrl.length ? (
285+
{fullRemoteThumbnailUrl.length ? (
278286
<img
279287
alt={t('Remote Space Image')}
280288
className={classes.spaceImage}
281-
src={remoteThumbnailUrl}
289+
src={fullRemoteThumbnailUrl}
282290
/>
283291
) : null}
284292
</Grid>

0 commit comments

Comments
 (0)