File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 104104 };
105105
106106 async function tryMicrobitUSBConnection(): Promise <void > {
107+ $connectionDialogState .connectionState = ConnectDialogStates .BROWSER_DIALOG ;
107108 let usb: MicrobitUSB | undefined ;
108109 try {
109110 usb = await MicrobitUSB .requestConnection ();
110111 } catch (err ) {
111- handleConnectionError (err );
112- return ;
112+ return handleConnectionError (err );
113113 }
114114 return flashMicrobit (usb );
115115 }
215215
216216<div bind:this ={dialogContainer }>
217217 <StandardDialog
218+ hideContent ={$connectionDialogState .connectionState ===
219+ ConnectDialogStates .BROWSER_DIALOG }
218220 isOpen ={$connectionDialogState .connectionState !== ConnectDialogStates .NONE &&
219221 ! endOfFlow }
220222 onClose ={connectionStateNone }
Original file line number Diff line number Diff line change 1818 export let closeOnEscape: boolean = true ;
1919 export let isOpen: boolean ;
2020 export let onClose: () => void ;
21+ export let hideContent: boolean = false ;
2122
2223 let finalFocusRef: Element | null ;
2324
9091 <div
9192 use:melt ={$content }
9293 class =" w-min h-min border-gray-200 border border-solid relative bg-white rounded-lg p-8 z-15"
94+ class:hidden ={hideContent }
9395 transition:scale ={{
9496 duration : 200 ,
9597 start : 0.9 ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export enum ConnectDialogStates {
2727 MANUAL_TUTORIAL , // Prompt with tutorial gif for manual installation (and downloading of program)
2828 USB_TRY_AGAIN , // Prompt user to try connecting via WebUSB again
2929 BLUETOOTH_TRY_AGAIN , // Prompt user to try connecting via WebBluetooth again
30+ BROWSER_DIALOG , // Awaiting user interaction with browser dialog
3031}
3132
3233export const connectionDialogState = writable < {
You can’t perform that action at this time.
0 commit comments