@ray-js/robot-data-stream 0.0.12 → 0.0.13-beta-1
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/lib/index.js +4 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -28,7 +28,6 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
|
28
28
|
}, onLogger);
|
|
29
29
|
isAppOnBackground.current = true;
|
|
30
30
|
if (isInit.current) {
|
|
31
|
-
// 判断进入后台之后,维持定时器,如果进入后台超过2分钟, 则断开P2P
|
|
32
31
|
timer.current = setTimeout(() => {
|
|
33
32
|
logger('info', {
|
|
34
33
|
msg: `background timer has been exe,isAppOnBackground: ${isAppOnBackground.current}`
|
|
@@ -45,6 +44,10 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
|
45
44
|
logger('info', {
|
|
46
45
|
msg: 'hooks onAppShow'
|
|
47
46
|
}, onLogger);
|
|
47
|
+
logger('info', {
|
|
48
|
+
msg: `clear timer ${timer.current}`
|
|
49
|
+
}, onLogger);
|
|
50
|
+
isAppOnBackground.current = false;
|
|
48
51
|
timer.current && clearTimeout(timer.current);
|
|
49
52
|
setTimeout(() => {
|
|
50
53
|
var _ty$p2p$isP2PActiveSy, _ty$p2p, _ty$p2p$isP2PActiveSy2, _ty$p2p2;
|