From 335e4527301c2bd63e3d9e90079548f4e6cb2ab9 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 20 Apr 2022 15:50:28 +1000 Subject: [PATCH] moved DebugLogView to components folder --- package.json | 2 +- ts/{views => components}/DebugLogView.tsx | 0 ts/mains/debug_log_start.tsx | 14 +------------- ts/test/test-utils/utils/stubbing.ts | 10 ++++++---- 4 files changed, 8 insertions(+), 18 deletions(-) rename ts/{views => components}/DebugLogView.tsx (100%) diff --git a/package.json b/package.json index 53f2334f4..47b934235 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "util-worker": { "source": "ts/webworker/workers/util.worker.ts", "distDir": "./ts/webworker/workers/", - "optimize" : false, + "optimize" : true, "sourceMap": false, "context": "web-worker" } diff --git a/ts/views/DebugLogView.tsx b/ts/components/DebugLogView.tsx similarity index 100% rename from ts/views/DebugLogView.tsx rename to ts/components/DebugLogView.tsx diff --git a/ts/mains/debug_log_start.tsx b/ts/mains/debug_log_start.tsx index 4d0988473..a81f6027d 100644 --- a/ts/mains/debug_log_start.tsx +++ b/ts/mains/debug_log_start.tsx @@ -1,18 +1,6 @@ -// /* global $: false */ -// /* global Whisper: false */ - import React from 'react'; -import { DebugLogView } from '../views/DebugLogView'; - -// $(document).on('keyup', e => { -// 'use strict'; - -// if (e.keyCode === 27) { -// window.closeDebugLog(); -// } -// }); +import { DebugLogView } from '../components/DebugLogView'; -// Whisper ? global.setTimeout(() => { window.ReactDOM.render(, document.getElementById('root')); }, 1000); diff --git a/ts/test/test-utils/utils/stubbing.ts b/ts/test/test-utils/utils/stubbing.ts index 6f96ae0a7..e17fc20e3 100644 --- a/ts/test/test-utils/utils/stubbing.ts +++ b/ts/test/test-utils/utils/stubbing.ts @@ -66,13 +66,15 @@ export function stubWindow(fn: K, value: WindowValue) }; } +const enableLogRedirect = false; + export const stubWindowLog = () => { stubWindow('log', { // tslint:disable: no-void-expression // tslint:disable: no-console - info: (args: any) => console.info(args), - warn: (args: any) => console.warn(args), - error: (args: any) => console.error(args), - debug: (args: any) => console.debug(args), + info: (args: any) => (enableLogRedirect ? console.info(args) : {}), + warn: (args: any) => (enableLogRedirect ? console.warn(args) : {}), + error: (args: any) => (enableLogRedirect ? console.error(args) : {}), + debug: (args: any) => (enableLogRedirect ? console.debug(args) : {}), }); };