@tuya-miniapp/ark-extension-virtual-device 1.3.0-beta-3 → 1.3.0-beta-5

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.
@@ -210199,7 +210199,7 @@ var require_package = __commonJS({
210199
210199
  "package.json"(exports, module2) {
210200
210200
  module2.exports = {
210201
210201
  name: "@tuya-miniapp/ark-extension-virtual-device",
210202
- version: "1.3.0-beta-2",
210202
+ version: "1.3.0-beta-4",
210203
210203
  license: "MIT",
210204
210204
  files: [
210205
210205
  "manifest.json",
@@ -251966,17 +251966,27 @@ var setDebugMode = async ({ mode }) => {
251966
251966
  await setCompilationParams({ deviceId });
251967
251967
  } else {
251968
251968
  const groupId = await getGroupId();
251969
- await setCompilationParams({ groupId, deviceId: "" });
251969
+ await setCompilationParams({ groupId: groupId ?? "" });
251970
251970
  }
251971
251971
  return mode;
251972
251972
  };
251973
251973
  var setCompilationParams = async (p2) => {
251974
251974
  const { page, params } = await ark.project.getCompilationParams() || {};
251975
+ const mode = await getDebugMode();
251975
251976
  let debugParams = parseSearchParams(params);
251976
- const np = stringifySearchParams({ ...debugParams, ...p2 });
251977
+ const realParams = {};
251978
+ Object.keys(debugParams).map((key) => {
251979
+ if (!!debugParams[key] && debugParams[key] !== "undefined") {
251980
+ realParams[key] - debugParams[key];
251981
+ }
251982
+ });
251983
+ if (mode !== "group") {
251984
+ delete realParams["groupId"];
251985
+ }
251986
+ const np = stringifySearchParams({ ...realParams, ...p2 });
251977
251987
  ark.project.setCompilationParams({ page, params: np });
251978
251988
  console.log("---------------setCompilationParams-----------------------");
251979
- console.log(params, p2);
251989
+ console.log(params, np, p2);
251980
251990
  console.log("---------------setCompilationParams-----------------------");
251981
251991
  };
251982
251992
 
@@ -253791,7 +253801,7 @@ var startConnect = (0, import_lodash.debounce)(
253791
253801
  }
253792
253802
  }
253793
253803
  return;
253794
- } else if (!devInfo.isVirtualDevice) {
253804
+ } else if (!devInfo.devId?.startsWith("vdevo")) {
253795
253805
  const version = message.slice(0, 3).toString("utf8");
253796
253806
  console.log("------>>>>>>>>>>>>>>", version, deviceInfo);
253797
253807
  switch (version) {
@@ -268318,7 +268328,8 @@ async function initLaunchParams() {
268318
268328
  console.log("to getProjectDeviceId");
268319
268329
  let deviceId = await services_default.getProjectDeviceId();
268320
268330
  const groupId = await services_default.getGroupId();
268321
- if (groupId) {
268331
+ const mode = await services_default.getDebugMode();
268332
+ if (groupId && mode === "group") {
268322
268333
  await getGroupInfo({ groupId });
268323
268334
  deviceId = groupId;
268324
268335
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/ark-extension-virtual-device",
3
- "version": "1.3.0-beta-3",
3
+ "version": "1.3.0-beta-5",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "manifest.json",