mirror of
https://github.com/MultiMote/niimblue
synced 2026-01-19 19:37:11 +03:00
Replace $effect with $derived
This commit is contained in:
@@ -5,15 +5,11 @@
|
||||
import { FileUtils } from "../../utils/file_utils";
|
||||
|
||||
let fwVersion: string = $state("");
|
||||
let fwVersionValid: boolean = $state(false);
|
||||
let fwVersionValid: boolean = $derived(/^\d+\.\d+$/.test(fwVersion));
|
||||
let fwProgress: string = $state("");
|
||||
let fwData: Uint8Array | undefined = $state();
|
||||
let fwName: string = $state("");
|
||||
|
||||
$effect(() => {
|
||||
fwVersionValid = /^\d+\.\d+$/.test(fwVersion);
|
||||
});
|
||||
|
||||
const browseFw = async () => {
|
||||
const file = await FileUtils.pickAndReadBinaryFile("bin");
|
||||
fwData = file.data;
|
||||
|
||||
Reference in New Issue
Block a user