File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ const Collections = ({ updateCredentials }) => {
6161 if ( update . error ) {
6262 errorNotifications ( update )
6363 } else {
64- successNotification ( { message : `${ collection } is created!` , duration : 4000 , link : '#' } )
64+ successNotification ( { message : `${ collection } is created!` , duration : 4000 } )
6565 setCollectionsList ( prev => prev . map ( col => {
6666 if ( col . name === collection ) col . status = 'enqueued'
6767 return col
@@ -95,7 +95,7 @@ const Collections = ({ updateCredentials }) => {
9595 method : 'DELETE'
9696 } )
9797 if ( res . error ) errorNotifications ( res )
98- else successNotification ( { message : `${ collection } collection is removed from MeiliSearch!` , link : '#' , duration : 4000 } )
98+ else successNotification ( { message : `${ collection } collection is removed from MeiliSearch!` , duration : 4000 } )
9999 }
100100
101101 const addOrRemoveCollection = async ( row ) => {
Original file line number Diff line number Diff line change 1- export function errorNotifications ( { message, link, duration = 4000 } ) {
1+ export function errorNotifications ( { message, link } ) {
22 strapi . notification . toggle ( {
33 title : 'Operation on MeiliSearch failed' ,
44 type : 'warning' ,
55 message : message ,
6- ...( link ? { link : { url : link , label : 'more information ' } } : { } ) ,
7- timeout : duration
6+ ...( link && { link : { url : link , label : 'learn more ' } } ) ,
7+ blockTransition : true // The user has to close the error notification manually
88 } )
99}
1010
1111export function successNotification ( { message, duration = 4000 , link } ) {
1212 strapi . notification . toggle ( {
1313 type : 'success' ,
1414 message : message ,
15- ...( link ? { link : { url : link , label : 'more information ' } } : { } ) ,
15+ ...( link && { link : { url : link , label : 'learn more ' } } ) ,
1616 timeout : duration
1717 } )
1818}
You can’t perform that action at this time.
0 commit comments