From df374d4de2ce5f389a29bca9b923d573444ef0b0 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Fri, 28 Jul 2023 10:25:17 -0700 Subject: [PATCH] Display connection troubleshoot notification Summary: Reuse the function that was refactored on previous diff. Reviewed By: antonk52 Differential Revision: D47873752 fbshipit-source-id: 71e12cd34d1826080487297e308450cb2a2a5c26 --- .../src/dispatcher/flipperServer.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx index 695630b5a..03153c5b4 100644 --- a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx +++ b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx @@ -36,28 +36,21 @@ export function connectFlipperServerToStore( logger: Logger, ) { server.on('notification', ({type, title, description}) => { - const text = `[${type}] ${title}: ${description}`; - console.warn(text); + const key = `[${type}] ${title}: ${description}`; notification.open({ message: title, description: , type: type, duration: 0, - key: text, + key, }); }); server.on( 'connectivity-troubleshoot-notification', ({type, title, description}) => { - const text = `[${type}] ${title}: ${description}`; - notification.open({ - message: title, - description: , - type: type, - duration: 0, - key: text, - }); + const key = `[${type}] ${title}: ${description}`; + showConnectivityTroubleshootNotification(store, key, title, description); }, );