mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-14 04:42:03 +10:00
addressed codex review cleanup
This commit is contained in:
@@ -33,9 +33,12 @@ class _ScannerScreenState extends State<ScannerScreen> {
|
|||||||
_connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
_connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
||||||
|
|
||||||
_connectionListener = () {
|
_connectionListener = () {
|
||||||
|
final isCurrentRoute = ModalRoute.of(context)?.isCurrent ?? true;
|
||||||
if (_connector.state == MeshCoreConnectionState.disconnected) {
|
if (_connector.state == MeshCoreConnectionState.disconnected) {
|
||||||
_changedNavigation = false;
|
_changedNavigation = false;
|
||||||
} else if (_connector.state == MeshCoreConnectionState.connected &&
|
} else if (_connector.state == MeshCoreConnectionState.connected &&
|
||||||
|
_connector.activeTransport == MeshCoreTransportType.bluetooth &&
|
||||||
|
isCurrentRoute &&
|
||||||
!_changedNavigation) {
|
!_changedNavigation) {
|
||||||
_changedNavigation = true;
|
_changedNavigation = true;
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|||||||
@@ -344,10 +344,6 @@ class UsbSerialService {
|
|||||||
// with a dangling NativeCallable pointer.
|
// with a dangling NativeCallable pointer.
|
||||||
if (_useDesktopFlSerial) {
|
if (_useDesktopFlSerial) {
|
||||||
final serial = _serial;
|
final serial = _serial;
|
||||||
_serial = null;
|
|
||||||
_status = UsbSerialStatus.disconnected;
|
|
||||||
_connectedPortKey = null;
|
|
||||||
_connectedPortLabel = null;
|
|
||||||
try {
|
try {
|
||||||
if (serial?.isOpen() == FlOpenStatus.open) {
|
if (serial?.isOpen() == FlOpenStatus.open) {
|
||||||
serial?.closePort(); // synchronous C call — kills the SerialThread
|
serial?.closePort(); // synchronous C call — kills the SerialThread
|
||||||
|
|||||||
Reference in New Issue
Block a user