add conditions for test
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
probingComplete,
|
probingComplete,
|
||||||
probingFailed,
|
probingFailed,
|
||||||
probingStarted,
|
probingStarted,
|
||||||
|
systemReady
|
||||||
} from "$lib/ControllerState";
|
} from "$lib/ControllerState";
|
||||||
import { numberWithUnit } from "$lib/RegexHelpers";
|
import { numberWithUnit } from "$lib/RegexHelpers";
|
||||||
import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte";
|
import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte";
|
||||||
@@ -130,6 +131,17 @@
|
|||||||
|
|
||||||
async function begin() {
|
async function begin() {
|
||||||
try {
|
try {
|
||||||
|
if (!get(systemReady)) {
|
||||||
|
await new Promise(resolve => {
|
||||||
|
const unsubscribe = systemReady.subscribe(ready => {
|
||||||
|
if (ready) {
|
||||||
|
unsubscribe();
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$probingActive = true;
|
$probingActive = true;
|
||||||
assertValidProbeType();
|
assertValidProbeType();
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,17 @@ export const networkInfo = writable({});
|
|||||||
|
|
||||||
export const probingActive = writable(false);
|
export const probingActive = writable(false);
|
||||||
export const probeContacted = writable(false);
|
export const probeContacted = writable(false);
|
||||||
export const probingStarted = writable(false);
|
|
||||||
export const probingFailed = writable(false);
|
export const probingFailed = writable(false);
|
||||||
|
export const probingStarted = writable(false);
|
||||||
export const probingComplete = writable(false);
|
export const probingComplete = writable(false);
|
||||||
|
export const systemReady = writable(false);
|
||||||
|
|
||||||
export function handleControllerStateUpdate(state: Record<string, any>) {
|
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) {
|
if (state.pw === 0) {
|
||||||
probeContacted.set(true);
|
probeContacted.set(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user