From 0ea4ca888f3390d3ed44ccf2da6f8fbf3fcef671 Mon Sep 17 00:00:00 2001 From: kyungeunni Date: Tue, 7 Feb 2023 18:34:48 +0900 Subject: [PATCH] chore: deletes useless comments --- electron/api/recordJourney.ts | 6 ++---- src/App.tsx | 1 - src/hooks/useRecordingContext.ts | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/electron/api/recordJourney.ts b/electron/api/recordJourney.ts index 9691078c..260c10f4 100644 --- a/electron/api/recordJourney.ts +++ b/electron/api/recordJourney.ts @@ -21,12 +21,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { BrowserWindow, ipcMain, IpcMainInvokeEvent } from 'electron'; -import type { BrowserContext } from 'playwright-core'; - import path from 'path'; import { EventEmitter, once } from 'events'; import { existsSync } from 'fs'; +import { BrowserWindow, ipcMain, IpcMainInvokeEvent } from 'electron'; +import type { BrowserContext } from 'playwright-core'; import logger from 'electron-log'; import { ActionInContext } from '../../common/types'; import { BrowserManager } from '../browserManager'; @@ -48,7 +47,6 @@ export async function recordJourney( // Listen to actions from Playwright recording session const actionsHandler = (actions: ActionInContext[]) => { - // ipcMain.callRenderer(browserWindow, 'change', { actions }); browserWindow.webContents.send('change', actions); }; actionListener.on('actions', actionsHandler); diff --git a/src/App.tsx b/src/App.tsx index 857de040..a12d1562 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -91,7 +91,6 @@ export default function App() { return generateMergedIR(prevSteps, nextSteps); }); }; - // ipc.answerMain('change', listener); const removeListener = electronAPI.onActionGenerated(listener); return removeListener; }, [electronAPI, setSteps]); diff --git a/src/hooks/useRecordingContext.ts b/src/hooks/useRecordingContext.ts index f45ed43d..5f66d1d8 100644 --- a/src/hooks/useRecordingContext.ts +++ b/src/hooks/useRecordingContext.ts @@ -50,11 +50,9 @@ export function useRecordingContext( } else if (recordingStatus === RecordingStatus.Recording) { setRecordingStatus(RecordingStatus.NotRecording); // Stop browser process - // ipc.send('stop'); electronAPI.stopRecording(); } else { setRecordingStatus(RecordingStatus.Recording); - // await ipc.callMain('record-journey', { url }); await electronAPI.recordJourney(url); setRecordingStatus(RecordingStatus.NotRecording); } @@ -67,7 +65,6 @@ export function useRecordingContext( // Depends on the result's context, because when we overwrite // a previous journey we need to discard its result status setResult(undefined); - // await ipc.callMain('record-journey', { url }); await electronAPI.recordJourney(url); setRecordingStatus(RecordingStatus.NotRecording); } @@ -77,10 +74,8 @@ export function useRecordingContext( if (recordingStatus === RecordingStatus.NotRecording) return; if (recordingStatus !== RecordingStatus.Paused) { setRecordingStatus(RecordingStatus.Paused); - // await ipc.callMain('set-mode', 'none'); await electronAPI.pauseRecording(); } else { - // await ipc.callMain('set-mode', 'recording'); await electronAPI.resumeRecording(); setRecordingStatus(RecordingStatus.Recording); }