From 0350935c683f3942975e0f87070029806ecef749 Mon Sep 17 00:00:00 2001 From: heicg Date: Wed, 21 Feb 2024 21:26:06 -0400 Subject: [PATCH] fix simple verification to regex.search --- weditor/static/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weditor/static/js/index.js b/weditor/static/js/index.js index cf0daf0..41c1e29 100644 --- a/weditor/static/js/index.js +++ b/weditor/static/js/index.js @@ -945,7 +945,7 @@ window.vm = new Vue({ const m = this.deviceId.match(/^([^:]+):(.*)/) const deviceUrl = m[2] let codeLines; - if (m[1] == "ios") { + if (m[1].search(/ios/i) != -1) { codeLines = [ "print('Set environment for iOS device\\nInit c = d = wda.Client()')", "import os", @@ -953,7 +953,7 @@ window.vm = new Vue({ `os.environ['DEVICE_URL'] = "${deviceUrl}"`, `c = d = wda.Client()`, ] - } else if (m[1] == "android") { + } else if (m[1].search(/android/i) != -1) { codeLines = [ "print('Set environment and prepare d = u2.connect()')", "import os",