Skip to content

Commit

Permalink
remove preview report handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Feb 5, 2024
1 parent 064e1e2 commit 313968e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 48 deletions.
31 changes: 0 additions & 31 deletions editor/src/components/editor/preview-report-handler.ts

This file was deleted.

2 changes: 2 additions & 0 deletions editor/src/core/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,10 @@ export function wrapWithSemaphore<Args extends unknown[], ReturnValue>(
}

semaphoreState = 'running'
// console.log(`${label} running`)

const result = inner(...args)
// console.log(`${label} not running`)
semaphoreState = 'not-running'
return result
}
Expand Down
17 changes: 0 additions & 17 deletions editor/src/templates/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ import { isLoggedIn } from '../components/editor/action-types'
import * as EditorActions from '../components/editor/actions/action-creators'
import { EditorComponent } from '../components/editor/editor-component'
import * as History from '../components/editor/history'
import {
InternalPreviewTimeout,
previewIsAlive,
startPreviewConnectedMonitoring,
} from '../components/editor/preview-report-handler'
import {
downloadGithubRepo,
getLoginState,
Expand Down Expand Up @@ -212,8 +207,6 @@ export class Editor {
domWalkerMutableState: DomWalkerMutableStateData

constructor() {
startPreviewConnectedMonitoring(this.boundDispatch)

let emptyEditorState = createEditorState(this.boundDispatch)
const derivedState = deriveState(
emptyEditorState,
Expand All @@ -228,8 +221,6 @@ export class Editor {

window.addEventListener('blur', this.resetStateOnBlur)

window.addEventListener('message', this.onMessage)

const watchdogWorker = new RealWatchdogWorker()

const renderRootEditor = () =>
Expand Down Expand Up @@ -397,14 +388,6 @@ export class Editor {
})
}

onMessage = (event: MessageEvent): void => {
const eventData = event.data
if (isSendPreviewModel(eventData)) {
previewIsAlive(InternalPreviewTimeout)
this.boundDispatch([eventData], 'noone')
}
}

resetStateOnBlur = (): void => {
this.boundDispatch(
[
Expand Down

0 comments on commit 313968e

Please sign in to comment.