@momo-kits/foundation 0.150.2-beta.32 → 0.150.2-beta.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.
|
@@ -285,15 +285,15 @@ const StackScreen: React.FC<any> = props => {
|
|
|
285
285
|
* tracking for loading screen
|
|
286
286
|
*/
|
|
287
287
|
const onScreenLoading = () => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
const start = tracking.current.timeStartLoading;
|
|
289
|
+
const end = tracking.current.timeEndLoading;
|
|
290
|
+
if (!tracking.current?.releaseLoading && start && end && end > start) {
|
|
291
291
|
context?.autoTracking?.({
|
|
292
292
|
...context,
|
|
293
293
|
screenName,
|
|
294
294
|
componentName: 'Screen',
|
|
295
295
|
state: 'loading',
|
|
296
|
-
duration:
|
|
296
|
+
duration: end - start,
|
|
297
297
|
loadingType: 'skeleton',
|
|
298
298
|
});
|
|
299
299
|
tracking.current.releaseLoading = true;
|
|
@@ -380,7 +380,6 @@ const StackScreen: React.FC<any> = props => {
|
|
|
380
380
|
/**
|
|
381
381
|
* tracking for loading screen
|
|
382
382
|
*/
|
|
383
|
-
clearTimeout(tracking.current.timeoutLoading);
|
|
384
383
|
if (!loading) {
|
|
385
384
|
tracking.current.timeEndLoading = Date.now();
|
|
386
385
|
}
|
|
@@ -388,6 +387,7 @@ const StackScreen: React.FC<any> = props => {
|
|
|
388
387
|
/**
|
|
389
388
|
* timeout for handle tracking screen
|
|
390
389
|
*/
|
|
390
|
+
clearTimeout(tracking.current.timeoutLoading);
|
|
391
391
|
tracking.current.timeoutLoading = setTimeout(() => {
|
|
392
392
|
onScreenLoading();
|
|
393
393
|
}, 2000);
|