This commit is contained in:
Alexandre Côté 2024-08-14 09:00:59 -04:00 committed by GitHub
commit e4aee32ede
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'remotedev-redux-devtools-extension': patch
---
Avoid auto-selecting instance with iFrames

View File

@ -13,7 +13,16 @@ function selectInstance(
) {
const instances = store.getState().instances;
if (instances.current === 'default') return;
const connections = instances.connections[tabId];
const connections = Object.entries(instances.connections).reduce<
(string | number)[]
>((acc, [key, connections]) => {
if (key.startsWith(String(tabId))) {
return [...acc, ...connections];
}
return acc;
}, []);
if (connections && connections.length === 1) {
next({ type: SELECT_INSTANCE, selected: connections[0] });
}