@ray-js/robot-data-stream 0.0.7 → 0.0.9

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -20,10 +20,6 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
20
20
  if (logTag) {
21
21
  log4js.setTag(logTag);
22
22
  }
23
- if (devId.startsWith('vdevo')) {
24
- log4js.warn('virtual device cannot use p2p');
25
- return;
26
- }
27
23
  if (isIDE) {
28
24
  log4js.warn(`You are using the IDE environment. To perform P2P and map debugging, please ensure the 'Robot Vacuum Debugger' plugin is installed.`);
29
25
  SweeperP2pInstance.onReceiveMapData = onReceiveMapData;
@@ -33,6 +29,10 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
33
29
  SweeperP2pInstance.removeP2pDownloadEvent();
34
30
  };
35
31
  }
32
+ if (devId.startsWith('vdevo')) {
33
+ log4js.warn('virtual device cannot use p2p');
34
+ return;
35
+ }
36
36
  SweeperP2pInstance.initP2pSdk(devId).then(() => {
37
37
  connectP2p();
38
38
  });
@@ -105,6 +105,7 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
105
105
  const onEnterForeground = () => {
106
106
  ty.onAppShow(() => {
107
107
  log4js.info('hooks onAppShow');
108
+ timer.current && clearTimeout(timer.current);
108
109
  setTimeout(() => {
109
110
  var _ty$p2p$isP2PActiveSy, _ty$p2p;
110
111
  if (!isInit.current || !((_ty$p2p$isP2PActiveSy = (_ty$p2p = ty.p2p).isP2PActiveSync) !== null && _ty$p2p$isP2PActiveSy !== void 0 && _ty$p2p$isP2PActiveSy.call(_ty$p2p, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/robot-data-stream",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "扫地机P2P数据流标准化组件",
5
5
  "main": "lib/index",
6
6
  "files": [