From 357d2991d5e2a983b9e7c5f924a51983125e182f Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 26 Feb 2021 07:24:40 -0800 Subject: [PATCH] automatically select reconnected clients Summary: Changelog: Flipper will no automatically select any newly connected client This reverts D26250896 (https://github.com/facebook/flipper/commit/2df117923c4ae841fec0fb99500ac2a6af9e8fe3) to V5, which is to aggressively select new clients. The current behavior was too conservative and caused Flipper to jump to a different client, without returning, after reconnecting a disconnected device. As reported in https://fb.workplace.com/groups/flippersupport/permalink/1084676302013027/ Reviewed By: fabiomassimo Differential Revision: D26691046 fbshipit-source-id: b16af2052f58dc1d4254eb1e6ebbb5848c53ed7e --- desktop/app/src/dispatcher/server.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/desktop/app/src/dispatcher/server.tsx b/desktop/app/src/dispatcher/server.tsx index 92b428a54..6b5081982 100644 --- a/desktop/app/src/dispatcher/server.tsx +++ b/desktop/app/src/dispatcher/server.tsx @@ -122,18 +122,7 @@ export function registerNewClient(store: Store, client: Client) { const device = client.deviceSync; if (device) { - const selectedDevice = connections.selectedDevice; - const selectedClient = connections.clients.find( - (c) => c.id === connections.selectedApp, - ); - if ( - // If this condition meets, it means that the previous app wasn't selected explicitly by the user - connections.selectedApp !== connections.userPreferredApp || - !selectedClient || - !selectedDevice - ) { - store.dispatch(selectDevice(device)); - store.dispatch(selectClient(client.id)); - } + store.dispatch(selectDevice(device)); + store.dispatch(selectClient(client.id)); } }