File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
import { SerialLaunchButton } from "./serial-launch-button.js" ;
2
- import "./serial-provision-dialog.js" ;
3
2
4
3
export const startProvisioning = async ( button : SerialLaunchButton ) => {
4
+ import ( "./serial-provision-dialog.js" ) ;
5
5
let port : SerialPort | undefined ;
6
6
try {
7
7
port = await navigator . serial . requestPort ( ) ;
Original file line number Diff line number Diff line change
1
+ import { startProvisioning } from "./provision" ;
2
+
1
3
export class SerialLaunchButton extends HTMLElement {
2
4
public static isSupported = "serial" in navigator ;
3
5
@@ -61,11 +63,6 @@ export class SerialLaunchButton extends HTMLElement {
61
63
62
64
this . toggleAttribute ( "supported" , true ) ;
63
65
64
- this . addEventListener ( "mouseover" , ( ) => {
65
- // Preload
66
- import ( "./provision" ) ;
67
- } ) ;
68
-
69
66
const slot = document . createElement ( "slot" ) ;
70
67
slot . name = "activate" ;
71
68
const button = document . createElement ( "button" ) ;
@@ -74,8 +71,7 @@ export class SerialLaunchButton extends HTMLElement {
74
71
75
72
slot . addEventListener ( "click" , async ( ev ) => {
76
73
ev . preventDefault ( ) ;
77
- const mod = await import ( "./provision" ) ;
78
- mod . startProvisioning ( this ) ;
74
+ startProvisioning ( this ) ;
79
75
} ) ;
80
76
81
77
if (
You can’t perform that action at this time.
0 commit comments