@@ -33,7 +33,7 @@ function _Connect(): JSX.Element | null {
setSupported(supported);
if (!supported){
globalState.showErrorDialog('Your browser does not support WebUSB standard, which is required for this site to work.\n\nLatest version of Google Chrome, Microsoft Edge, or other Chromium-based browsers are required.');
GlobalState.showErrorDialog('Your browser does not support WebUSB standard, which is required for this site to work.\n\nLatest version of Google Chrome, Microsoft Edge, or other Chromium-based browsers are required.');
return;
}
@@ -153,18 +153,18 @@ function _Connect(): JSX.Element | null {
readable=streams.readable
.pipeThrough(
newInspectStream(packet=>{
globalState.appendLog('in',packet);
GlobalState.appendLog('in',packet);
})
);
writable=pipeFrom(
streams.writable,
newInspectStream((packet:AdbPacketInit)=>{
globalState.appendLog('out',packet);
GlobalState.appendLog('out',packet);
})
);
}catch (e:any){
globalState.showErrorDialog(e);
GlobalState.showErrorDialog(e);
setConnecting(false);
return;
}
@@ -174,7 +174,7 @@ function _Connect(): JSX.Element | null {
// so manually close them.
try{readable.cancel();}catch{}
try{awaitwritable.close();}catch{}
globalState.setDevice(undefined,undefined);
GlobalState.setDevice(undefined,undefined);
}
try{
@@ -187,13 +187,13 @@ function _Connect(): JSX.Element | null {
device.disconnected.then(async ()=>{
awaitdispose();
},async (e)=>{
globalState.showErrorDialog(e);
GlobalState.showErrorDialog(e);
awaitdispose();
});
globalState.setDevice(selectedBackend,device);
GlobalState.setDevice(selectedBackend,device);
}catch (e:any){
globalState.showErrorDialog(e);
GlobalState.showErrorDialog(e);
awaitdispose();
}finally{
setConnecting(false);
@@ -202,10 +202,10 @@ function _Connect(): JSX.Element | null {
constdisconnect=useCallback(async ()=>{
try{
awaitglobalState.device!.close();
globalState.setDevice(undefined,undefined);
awaitGlobalState.device!.close();
GlobalState.setDevice(undefined,undefined);
}catch (e:any){
globalState.showErrorDialog(e);
GlobalState.showErrorDialog(e);
}
},[]);
@@ -268,7 +268,7 @@ function _Connect(): JSX.Element | null {