@fto-consult/expo-ui 8.61.10 → 8.61.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.61.10",
3
+ "version": "8.61.11",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "react-native-paper-doc": "https://github.com/callstack/react-native-paper/tree/main/docs/docs/guides",
6
6
  "scripts": {
@@ -3565,6 +3565,16 @@ export default class CommonDatagridComponent extends AppComponent {
3565
3565
  opts.onSuccess = cb = typeof cb =="function"? cb : typeof opts.onSuccess =='function'? opts.onSuccess : undefined;
3566
3566
  opts.force = defaultBool(force,opts.force,true)
3567
3567
  return new Promise((resolve,reject)=>{
3568
+ if(typeof this.props.onRefreshDatagrid =="function"){
3569
+ const r = this.props.onRefreshDatagrid({context:this});
3570
+ if(r === false){
3571
+ return resolve([]);
3572
+ }
3573
+ if(isPromise(r)){
3574
+ return r.then(resolve).catch(reject);
3575
+ }
3576
+ return resolve(r);
3577
+ }
3568
3578
  return this.fetchData(opts).then((data)=>{
3569
3579
  if(isFunction(cb)){
3570
3580
  cb(data,{...opts,context:this});
@@ -3572,11 +3582,7 @@ export default class CommonDatagridComponent extends AppComponent {
3572
3582
  if(typeof this.props.onRefresh ==='function'){
3573
3583
  this.props.onRefresh({...opts,context:this});
3574
3584
  }
3575
- }).then(resolve).catch(reject).finally(()=>{
3576
- if(typeof this.props.onRefreshDatagrid =="function"){
3577
- this.props.onRefreshDatagrid({context:this});
3578
- }
3579
- });
3585
+ }).then(resolve).catch(reject);
3580
3586
  })
3581
3587
  }
3582
3588
  componentDidMount(){