[AI Generated]: fix(Comp): 新增 SDK 超时取消机制,组件销毁时清除定时器防止残留提示
This commit is contained in:
@@ -20,6 +20,7 @@ Component({
|
||||
},
|
||||
detached() {
|
||||
console.log('configureDevice3 detached');
|
||||
if (this._sdkCancel) { this._sdkCancel(); this._sdkCancel = null; }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -34,7 +35,7 @@ Component({
|
||||
wx.showToast({ title: '设备未连接,请重试', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
app.callWithTimeout(
|
||||
this._sdkCancel = app.callWithTimeout(
|
||||
(done) => activeProtocol.dataFindSurroundDevice(done),
|
||||
SDK_TIMEOUT,
|
||||
(res) => {
|
||||
@@ -83,7 +84,7 @@ Component({
|
||||
|
||||
let version = app.globalData.ppScale.version;
|
||||
if (version === 'domain1') {
|
||||
app.callWithTimeout(
|
||||
this._sdkCancel = app.callWithTimeout(
|
||||
(done) => app.globalData.ppScale.activeProtocol.dataConfigNetWork({
|
||||
domain: app.globalData.ppScale.domain1,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
@@ -101,7 +102,7 @@ Component({
|
||||
);
|
||||
}
|
||||
if (version === 'domain2') {
|
||||
app.callWithTimeout(
|
||||
this._sdkCancel = app.callWithTimeout(
|
||||
(done) => app.globalData.ppScale.activeProtocol.dataConfigUserNetWork({
|
||||
domain: app.globalData.ppScale.domain2,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
|
||||
Reference in New Issue
Block a user