feat: add pre-ccos hint when connection errors

resolves #99
This commit is contained in:
2024-04-06 17:43:43 +02:00
parent b423d1c661
commit 5b6d369101

View File

@@ -23,6 +23,17 @@
powerDialog = false; powerDialog = false;
} }
async function connect() {
try {
await initSerial(true);
} catch (error) {
console.error(error);
alert(
"Connection failed. Is your device maybe pre-CCOS? Refer to the doc link in the bottom left for more information on your device.",
);
}
}
let rebootInfo = false; let rebootInfo = false;
let terminal = false; let terminal = false;
let powerDialog = false; let powerDialog = false;
@@ -114,7 +125,7 @@
>{$LL.deviceManager.DISCONNECT()}</button >{$LL.deviceManager.DISCONNECT()}</button
> >
{:else} {:else}
<button class="error" on:click={() => initSerial(true)} <button class="error" on:click={connect}
><span class="icon">usb</span>{$LL.deviceManager.CONNECT()}</button ><span class="icon">usb</span>{$LL.deviceManager.CONNECT()}</button
> >
{/if} {/if}