mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-23 10:22:41 +00:00
feat: enable stricter type checking options
feat: make the app more fault tolerant
This commit is contained in:
@@ -40,7 +40,6 @@ function NativeSerialPort(info: SerialPortInfo): TauriSerialPort {
|
||||
}
|
||||
|
||||
// @ts-expect-error polyfill
|
||||
// noinspection JSConstantReassignment
|
||||
navigator.serial = {
|
||||
async getPorts(): Promise<SerialPort[]> {
|
||||
return invoke<any[]>("plugin:serial|get_serial_ports").then((ports) =>
|
||||
@@ -69,6 +68,7 @@ navigator.serial = {
|
||||
props: { ports },
|
||||
});
|
||||
const port = await new Promise<SerialPort>((resolve) =>
|
||||
// @ts-expect-error polyfill
|
||||
dialog.$on("confirm", resolve),
|
||||
);
|
||||
dialog.$destroy();
|
||||
|
||||
Reference in New Issue
Block a user