|
2 | 2 | import { MessageCircleQuestion, SquareTerminal } from '@lucide/svelte'; |
3 | 3 | import { browser } from '$app/environment'; |
4 | 4 | import { PUBLIC_DISCORD_INVITE_URL } from '$env/static/public'; |
5 | | - import FlashManager from '$lib/EspTool/FlashManager'; |
6 | 5 | import Container from '$lib/components/Container.svelte'; |
7 | 6 | import FirmwareChannelSelector from '$lib/components/FirmwareChannelSelector.svelte'; |
8 | 7 | import TextInput from '$lib/components/input/TextInput.svelte'; |
|
15 | 14 | import { Label } from '$lib/components/ui/label'; |
16 | 15 | import { Progress } from '$lib/components/ui/progress'; |
17 | 16 | import { Sheet, SheetContent, SheetHeader, SheetTitle } from '$lib/components/ui/sheet'; |
18 | | - import { FlashManagerStore } from '$lib/stores/FlashManagersStore'; |
19 | 17 | import { isSerialSupported } from '$lib/utils/compatibility'; |
20 | 18 | import Bowser from 'bowser'; |
21 | 19 | import FirmwareBoardSelector from './FirmwareBoardSelector.svelte'; |
22 | 20 | import FirmwareFlasher from './FirmwareFlasher.svelte'; |
| 21 | + import FlashManager from './FlashManager'; |
23 | 22 | import HelpDialog from './HelpDialog.svelte'; |
24 | 23 | import SerialPortSelector from './SerialPortSelector.svelte'; |
25 | 24 |
|
|
47 | 46 | $effect(() => { |
48 | 47 | if (port && !manager) { |
49 | 48 | connectFailed = false; |
50 | | - FlashManagerStore.getManager(port, terminal).then((m) => { |
| 49 | + FlashManager.Connect(port, terminal).then((m) => { |
51 | 50 | manager = m; |
52 | | - if (!manager) { |
53 | | - connectFailed = true; |
54 | | - } |
| 51 | + connectFailed = !manager; |
55 | 52 | }); |
56 | 53 | } else if (!port && manager) { |
57 | | - FlashManagerStore.removeManager(manager); |
| 54 | + manager.disconnect(); |
58 | 55 | manager = null; |
59 | 56 | } |
60 | 57 | }); |
|
0 commit comments