add conditions for test
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user