Server notifications using connection troubleshoot notification

Summary: Migrate to new server event which allows troubleshoot

Reviewed By: passy

Differential Revision: D47875977

fbshipit-source-id: 2549bef6ebb26660176747d44e3f535ad9f1d213
This commit is contained in:
Lorenzo Blasa
2023-07-28 13:04:46 -07:00
committed by Facebook GitHub Bot
parent aaa0a01c6b
commit bf96cc2f15

View File

@@ -140,7 +140,7 @@ export class FlipperServerImpl implements FlipperServer {
server.addListener( server.addListener(
'client-setup-error', 'client-setup-error',
({client, error}: {client: UninitializedClient; error: Error}) => { ({client, error}: {client: UninitializedClient; error: Error}) => {
this.emit('notification', { this.emit('connectivity-troubleshoot-notification', {
title: `Connection to '${client.appName}' on '${client.deviceName}' failed`, title: `Connection to '${client.appName}' on '${client.deviceName}' failed`,
description: `Failed to start client connection: ${error}`, description: `Failed to start client connection: ${error}`,
type: 'error', type: 'error',
@@ -161,7 +161,7 @@ export class FlipperServerImpl implements FlipperServer {
const clientIdentifier = `${client.deviceName}#${client.appName}`; const clientIdentifier = `${client.deviceName}#${client.appName}`;
if (!this.unresponsiveClients.has(clientIdentifier)) { if (!this.unresponsiveClients.has(clientIdentifier)) {
this.unresponsiveClients.add(clientIdentifier); this.unresponsiveClients.add(clientIdentifier);
this.emit('notification', { this.emit('connectivity-troubleshoot-notification', {
type: 'error', type: 'error',
title: `Timed out establishing connection with "${client.appName}" on "${client.deviceName}".`, title: `Timed out establishing connection with "${client.appName}" on "${client.deviceName}".`,
description: description: