From 37d92dedaf1059b23837d9c8a5ac2e26b75cf4de Mon Sep 17 00:00:00 2001 From: DawidKossowskii Date: Fri, 22 Sep 2023 12:37:34 +0200 Subject: [PATCH] Removed .? from the code --- .../src/search/text/searchtextview.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/ckeditor5-ui/src/search/text/searchtextview.ts b/packages/ckeditor5-ui/src/search/text/searchtextview.ts index 7cb40e5528f..27a344ccb9a 100644 --- a/packages/ckeditor5-ui/src/search/text/searchtextview.ts +++ b/packages/ckeditor5-ui/src/search/text/searchtextview.ts @@ -289,11 +289,21 @@ export default class SearchTextView< let primaryText, secondaryText; if ( data.totalItemsCount ) { - primaryText = defaultTextConfig?.notFound?.primary || t( 'No results found' ); - secondaryText = defaultTextConfig?.notFound?.secondary || ''; + if ( defaultTextConfig && defaultTextConfig.notFound ) { + primaryText = defaultTextConfig.notFound.primary; + secondaryText = defaultTextConfig.notFound.secondary; + } else { + primaryText = t( 'No results found' ); + secondaryText = ''; + } } else { - primaryText = defaultTextConfig?.noSearchableItems?.primary || t( 'No searchable items' ); - secondaryText = defaultTextConfig?.noSearchableItems?.secondary || ''; + if ( defaultTextConfig && defaultTextConfig.noSearchableItems ) { + primaryText = defaultTextConfig.noSearchableItems.primary; + secondaryText = defaultTextConfig.noSearchableItems.secondary; + } else { + primaryText = t( 'No searchable items' ); + secondaryText = ''; + } } infoView.set( {