Skip to content

Commit 182f4f5

Browse files
committed
Improve auto-open-after-setup Frida flow
1 parent b1bb3cc commit 182f4f5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/intercept/config/frida-config.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,17 @@ class FridaConfig extends React.Component<{
306306
});
307307

308308
this.setHostProgress(hostId, 100);
309-
await delay(10); // Tiny delay purely for nice UI purposes
310-
this.viewHostTargets(hostId);
309+
await delay(10); // Tiny delay, purely for nice UI purposes
310+
311+
// When launch succeeds, it guarantees that the current state is now available.
312+
// We directly check that, rather than waiting for the next metadata update:
313+
runInAction(() => {
314+
this.props.interceptor.metadata!.hosts[hostId].state = 'available';
315+
});
316+
317+
if (Object.values(this.hostProgress).length === 1) { // Don't jump if setting up multiple devices
318+
this.viewHostTargets(hostId);
319+
}
311320
} finally {
312321
clearInterval(interval);
313322
this.setHostProgress(hostId, undefined);

0 commit comments

Comments
 (0)