Remove NEW_CLIENT_SANITY_CHECK
Summary: This isn't needed anymore as it's taken care of by the Client class when it fails to find it's own matching device. Reviewed By: mweststrate Differential Revision: D19499929 fbshipit-source-id: e54dea6e680a9fa3cd3572cdd65434922d51c4ea
This commit is contained in:
committed by
Facebook Github Bot
parent
a3a3db5363
commit
06218b13f8
@@ -23,13 +23,6 @@ export default (store: Store, logger: Logger) => {
|
||||
type: 'NEW_CLIENT',
|
||||
payload: client,
|
||||
});
|
||||
// Wait 2 seconds, and then trigger another event so we can check it's displayed
|
||||
setTimeout(() => {
|
||||
store.dispatch({
|
||||
type: 'NEW_CLIENT_SANITY_CHECK',
|
||||
payload: client,
|
||||
});
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
server.addListener('removed-client', (id: string) => {
|
||||
|
||||
@@ -103,10 +103,6 @@ export type Action =
|
||||
type: 'NEW_CLIENT';
|
||||
payload: Client;
|
||||
}
|
||||
| {
|
||||
type: 'NEW_CLIENT_SANITY_CHECK';
|
||||
payload: Client;
|
||||
}
|
||||
| {
|
||||
type: 'CLIENT_REMOVED';
|
||||
payload: string;
|
||||
@@ -293,25 +289,6 @@ const reducer = (state: State = INITAL_STATE, action: Actions): State => {
|
||||
});
|
||||
}
|
||||
|
||||
case 'NEW_CLIENT_SANITY_CHECK': {
|
||||
const {payload} = action;
|
||||
// Check for clients initialised when there is no matching device
|
||||
const clientIsStillConnected = state.clients.filter(
|
||||
client => client.id == payload.query.device_id,
|
||||
);
|
||||
if (clientIsStillConnected) {
|
||||
const matchingDeviceForClient = state.devices.filter(
|
||||
device => payload.query.device_id === device.serial,
|
||||
);
|
||||
if (matchingDeviceForClient.length === 0) {
|
||||
console.error(
|
||||
`Client initialised for non-displayed device: ${payload.id}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
case 'CLIENT_REMOVED': {
|
||||
const {payload} = action;
|
||||
return updateSelection({
|
||||
|
||||
Reference in New Issue
Block a user