From 2c38b8a764bc43582979ccb3a37b2f3e0c5ae6b0 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 3 Oct 2023 12:44:00 +0900 Subject: [PATCH] fix(tuna-obs): change to not print messages when not in development mode --- plugins/tuna-obs/back.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/tuna-obs/back.ts b/plugins/tuna-obs/back.ts index c01b6557..f08ae22d 100644 --- a/plugins/tuna-obs/back.ts +++ b/plugins/tuna-obs/back.ts @@ -1,4 +1,5 @@ import { ipcMain, net, BrowserWindow } from 'electron'; +import is from 'electron-is'; import registerCallback from '../../providers/song-info'; @@ -41,7 +42,11 @@ const post = (data: Data) => { method: 'POST', headers, body: JSON.stringify({ data }), - }).catch((error: { code: number, errno: number }) => console.log(`Error: '${error.code || error.errno}' - when trying to access obs-tuna webserver at port ${port}`)); + }).catch((error: { code: number, errno: number }) => { + if (is.dev()) { + console.debug(`Error: '${error.code || error.errno}' - when trying to access obs-tuna webserver at port ${port}`); + } + }); }; export default (win: BrowserWindow) => {