add conditions for test

This commit is contained in:
bsaravanan783
2025-06-03 10:54:57 +05:30
parent 667e55fcef
commit c4fb15fdb9
2 changed files with 18 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
probingComplete,
probingFailed,
probingStarted,
systemReady
} from "$lib/ControllerState";
import { numberWithUnit } from "$lib/RegexHelpers";
import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte";
@@ -130,6 +131,17 @@
async function begin() {
try {
if (!get(systemReady)) {
await new Promise(resolve => {
const unsubscribe = systemReady.subscribe(ready => {
if (ready) {
unsubscribe();
resolve(true);
}
});
});
}
$probingActive = true;
assertValidProbeType();

View File

@@ -5,13 +5,17 @@ export const networkInfo = writable({});
export const probingActive = writable(false);
export const probeContacted = writable(false);
export const probingStarted = writable(false);
export const probingFailed = writable(false);
export const probingStarted = writable(false);
export const probingComplete = writable(false);
export const systemReady = writable(false);
export function handleControllerStateUpdate(state: Record<string, any>) {
if (!get(systemReady)) {
systemReady.set(true);
}
if (get(probingActive)) {
if (get(probingActive) && get(systemReady)) {
if (state.pw === 0) {
probeContacted.set(true);
}