From 63fed3d3b1487b33760bf4cad1f0c0684a8afdb4 Mon Sep 17 00:00:00 2001 From: Elena Shorohova <92329687+jsorohova@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:01:38 +0100 Subject: [PATCH] Fixed Settings modal incorrect behaviour (#2361) --- src/admin/media/mediaSelectionItemModal.tsx | 2 +- src/admin/settings/settingsModal.tsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/admin/media/mediaSelectionItemModal.tsx b/src/admin/media/mediaSelectionItemModal.tsx index adeb3e1e7..321cad8f4 100644 --- a/src/admin/media/mediaSelectionItemModal.tsx +++ b/src/admin/media/mediaSelectionItemModal.tsx @@ -110,7 +110,7 @@ export class MediaSelectionItemModal extends React.Component this.props.selectMedia(mediaItem)}> +
this.props.selectMedia(mediaItem)} key={mediaItem.key}> => { - const settings = await this.siteService.getSetting('site'); - const faviconFile = await this.mediaService.getMediaByKey(settings.faviconSourceKey); + const settings = await this.siteService.getSetting('site'); this.setState({ initialSettings: settings, settings: settings }); - this.getFaviconThumbnailUrl(faviconFile); + + if (settings.faviconSourceKey) { + const faviconFile = await this.mediaService.getMediaByKey(settings.faviconSourceKey); + this.getFaviconThumbnailUrl(faviconFile); + } } getFaviconThumbnailUrl = async (faviconFile: MediaContract): Promise => {