Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.eslintrc*.js
out/
out/
coverage/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
out/
coverage/
4 changes: 2 additions & 2 deletions src/panel/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Stack } from '@mui/material'
import * as React from 'react'
import { useEffect, useReducer } from 'react'
import { useLayoutEffect, useReducer } from 'react'

import * as Requests from './requests'

Expand All @@ -10,7 +10,7 @@ const App = () => {
[]
)

useEffect(() => {
useLayoutEffect(() => {
Requests.listen()
const unsubscribe = Requests.subscribe((req) => {
pushRequest(req)
Expand Down
13 changes: 11 additions & 2 deletions src/panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ import '@fontsource/roboto/400.css'
import '@fontsource/roboto/500.css'
import '@fontsource/roboto/700.css'
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { render, unmountComponentAtNode } from 'react-dom'

import App from './App'

ReactDOM.render(<App />, document.getElementById('app'))
const container = document.getElementById('app')
if (container === null) {
throw new Error('could not find #app container element')
}

render(<App />, container)

window.addEventListener('beforeunload', () => {
unmountComponentAtNode(container)
})