Skip to content

Commit 853a1dc

Browse files
committed
fix to coderabbit's qa
1 parent 9dbd54d commit 853a1dc

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

src/components/design-library-list/design-library-list-item.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { Tooltip } from '~stackable/components'
2121
import {
2222
useState, useRef, memo,
2323
useMemo,
24+
Fragment,
2425
} from '@wordpress/element'
2526
import { Dashicon, Spinner } from '@wordpress/components'
2627
import { __ } from '@wordpress/i18n'
@@ -120,7 +121,7 @@ const DesignLibraryListItem = memo( props => {
120121
showHideNote={ false }
121122
/>
122123
) }
123-
{ isPro && applyFilters( 'stackable.design-library.pattern-actions', previewProps ) }
124+
{ isPro && applyFilters( 'stackable.design-library.pattern-actions', Fragment, previewProps ) }
124125
<div className={ `stk-spinner-container ${ isLoading || ! shouldRender ? '' : 'stk-hide-spinner' }` }><Spinner /></div>
125126
<div
126127
className="stk-block-design__host-container"

src/welcome/import-export/index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,24 @@ const ImportSettings = ( {
7272
setNotice( __( 'Failed to import settings.', i18n ) )
7373
// eslint-disable-next-line no-console
7474
console.error( sprintf( __( 'Stackable: Import error - %s', i18n ), Object.values( errors ).join( '\n' ) ) )
75-
} else if ( Object.keys( settingsToSave ).length === 0 ) {
75+
return
76+
}
77+
78+
if ( Object.keys( settingsToSave ).length === 0 ) {
7679
setNotice( __( 'No settings imported.', i18n ) )
77-
} else {
78-
const model = new models.Settings( settingsToSave )
79-
try {
80-
await model.save()
81-
setNotice( __( 'Settings imported successfully.', i18n ) )
82-
} catch ( e ) {
83-
setNotice( __( 'Failed to import settings.', i18n ) )
84-
// eslint-disable-next-line no-console
85-
console.error( sprintf( __( 'Stackable: Import error - %s', i18n ), e ) )
86-
}
87-
}
80+
return
81+
}
8882

89-
onClose()
83+
const model = new models.Settings( settingsToSave )
84+
try {
85+
await model.save()
86+
setNotice( __( 'Settings imported successfully.', i18n ) )
87+
onClose()
88+
} catch ( e ) {
89+
setNotice( __( 'Failed to import settings.', i18n ) )
90+
// eslint-disable-next-line no-console
91+
console.error( sprintf( __( 'Stackable: Import error - %s', i18n ), e ) )
92+
}
9093
}
9194

9295
const AllImportSettings = useMemo( () => applyFilters( 'stackable.admin-settings.import-settings', Fragment ), [] )

0 commit comments

Comments
 (0)