@fto-consult/expo-ui 7.6.32 → 7.6.33
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
@@ -161,6 +161,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
161
161
|
const sortRef = React.useRef({});
|
162
162
|
const innerRef = React.useRef(null);
|
163
163
|
const showProgressRef = React.useRef(true);
|
164
|
+
const forceRefreshRef = React.useRef(true);
|
164
165
|
const pageRef = React.useRef(1);
|
165
166
|
const canHandlePagination = handlePagination !== false ? true : false;
|
166
167
|
const canHandleLimit = handleQueryLimit !== false && canHandlePagination ? true : false;
|
@@ -238,7 +239,8 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
238
239
|
showProgressRef.current = showProgress || typeof showProgress ==='boolean' ? showProgress : false;
|
239
240
|
const fPath = isNonNullString(fetchPath)? fetchPath : fPathRef.current;
|
240
241
|
const rKey = `${setQueryParams(fPath,"swrRefreshKeyId",uniqid("swr-refresh-key"))}`;
|
241
|
-
|
242
|
+
forceRefreshRef.current = true;
|
243
|
+
refresh(rKey);
|
242
244
|
}
|
243
245
|
const canPaginate = ()=>{
|
244
246
|
if(!canHandlePagination) return false;
|
@@ -302,6 +304,8 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
302
304
|
showProgressRef.current = false;
|
303
305
|
}
|
304
306
|
},[showProgressRef.current]);
|
307
|
+
const isAppLoading = loading && showProgressRef.current && forceRefreshRef.current || false;
|
308
|
+
forceRefreshRef.current = undefined;
|
305
309
|
return (
|
306
310
|
<Datagrid
|
307
311
|
testID = {testID}
|
@@ -408,7 +412,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
408
412
|
handleQueryLimit = {false}
|
409
413
|
handlePagination = {false}
|
410
414
|
autoSort = {canSortRemotely()? false : true}
|
411
|
-
isLoading = {
|
415
|
+
isLoading = {isAppLoading}
|
412
416
|
beforeFetchData = {(args)=>{
|
413
417
|
let {fetchOptions:opts,force,renderProgressBar} = args;
|
414
418
|
opts = getFetchOptions({showError:showProgressRef.current,...opts});
|