Skip to content

Commit

Permalink
fix(reconnect): Fixed the reverse order of the IOS redirect page when…
Browse files Browse the repository at this point in the history
… the device is offline (#187)
  • Loading branch information
ZengBeauty committed Mar 15, 2022
1 parent 920cad9 commit eabf874
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const TYNative = TYSdk.native;
const TYDevice = TYSdk.device;
const TYEvent = TYSdk.event;

const { convert } = RatioUtils;
const { convert, isIos } = RatioUtils;
const { compareVersion, get } = CoreUtils;
const OFFLINE_API_SUPPORT = TYMobile.verSupported('2.91');

Expand Down Expand Up @@ -87,9 +87,14 @@ export default class OfflineView extends Component {
const { devId } = TYSdk.devInfo;
const isJumpToWifi = this._handleVersionToJump();
if (isJumpToWifi) {
// 为了处理安卓的生命周期问题(可能会导致进入不了配网页面)
TYNative.jumpTo(`tuyaSmart://device_offline_reconnect?device_id=${devId}`);
TYMobile.back();
if (isIos) {
TYMobile.back();
TYNative.jumpTo(`tuyaSmart://device_offline_reconnect?device_id=${devId}`);
} else {
// 为了处理安卓的生命周期问题(可能会导致进入不了配网页面)
TYNative.jumpTo(`tuyaSmart://device_offline_reconnect?device_id=${devId}`);
TYMobile.back();
}
}
};

Expand Down Expand Up @@ -236,7 +241,8 @@ export default class OfflineView extends Component {
const isWifiDevice = capability === 1;
if (isWifiDevice || !appOnline) {
return this.renderOldView();
} else if (isBleDevice) {
}
if (isBleDevice) {
return this.renderBleView();
}
}
Expand All @@ -248,19 +254,19 @@ export default class OfflineView extends Component {
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
alignSelf: 'center',
backgroundColor: `rgba(0, 0, 0, 0.8)`,
justifyContent: 'center',
},
icon: {
height: convert(81),
resizeMode: 'stretch',
width: convert(121),
height: convert(81),
},
tip: {
marginTop: convert(14),
fontSize: 16,
color: 'white',
fontSize: 16,
marginTop: convert(14),
textAlign: 'center',
},
});

0 comments on commit eabf874

Please sign in to comment.