From ccdc6735c6a66774af0dc4234a01e89eb5783811 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 24 Mar 2023 06:34:38 -0700 Subject: [PATCH] Log mock errors only for connected devices Reviewed By: antonk52 Differential Revision: D44367935 fbshipit-source-id: e6de3bf08d9daef9e607b9d24200892f4d04ecd2 --- desktop/plugins/public/network/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/network/index.tsx b/desktop/plugins/public/network/index.tsx index 0c9f6590b..3c931648c 100644 --- a/desktop/plugins/public/network/index.tsx +++ b/desktop/plugins/public/network/index.tsx @@ -258,7 +258,11 @@ export function plugin(client: PluginClient) { informClientMockChange(routes.get()); }) - .catch((e) => console.error('[network] Failed to init mocks:', e)); + .catch((e) => { + if (client.device.connected.get()) { + console.error('[network] Failed to init mocks:', e); + } + }); // declare new variable to be called inside the interface networkRouteManager.set(