eslint fix

This commit is contained in:
He4eT 2021-07-22 14:00:58 +05:00
commit cc1df287be
7 changed files with 27 additions and 23 deletions

View file

@ -52,7 +52,7 @@ export default function ({
useEffect(() => {
setTargetWindow(
windows
.find(({id}) =>
.find(({ id }) =>
id === currentWindowId))
}, [currentWindowId, windows])

View file

@ -1,9 +1,5 @@
import { h } from 'preact'
import { useState, useEffect } from 'preact/hooks'
import {
compressToUTF16 as encode,
decompressFromUTF16 as decode
} from 'lz-string'
import CheapGlkOte from 'cheap-glkote'
@ -13,7 +9,7 @@ import GridBuffer from './GridBuffer'
import InputBox from './InputBox'
import Status from './Status'
import {Handlers} from './playerHandlers'
import { Handlers } from './playerHandlers'
import './player.css'
@ -74,8 +70,8 @@ export default function ({
}
return ({
'buffer': <TextBuffer {...props} />,
'grid': <GridBuffer {...props} />
buffer: <TextBuffer {...props} />,
grid: <GridBuffer {...props} />
})[currentWindow.type]
}
@ -85,18 +81,19 @@ export default function ({
return status.stage !== 'ready'
? (<Status {...status} />)
: (<section className='ifplayer'>
<section className='output'>{
<section className='output'>{
windows
.sort(byTop)
.filter(singleWindow
? ({id}) => id === currentWindowId
? ({ id }) => id === currentWindowId
: _ => true)
.map(textWindow(inbox))}
</section>
<InputBox {...{
inputType,
windows,
currentWindowId,
sendMessage }} />
</section>)
</section>
<InputBox {...{
inputType,
windows,
currentWindowId,
sendMessage
}} />
</section>)
}

View file

@ -85,7 +85,7 @@ export default function ({ inbox, currentWindow }) {
tabindex='0'
ref={textBufferEl}
className={classes}>
{messages.map(TextMessage)}
{messages.map(TextMessage)}
</section>
)
}

View file

@ -50,6 +50,6 @@ export default function ({ url, singleWindow }) {
? (<Player {...{
vmParts,
singleWindow
}}/>)
}} />)
: (<Status {...status} />)
}

View file

@ -1,3 +1,8 @@
import {
compressToUTF16 as encode,
decompressFromUTF16 as decode
} from 'lz-string'
export const Handlers = ({
setStatus,
setWindows,
@ -13,9 +18,9 @@ export const Handlers = ({
setWindows(windows)
},
onUpdateInputs: data => {
if (data.length === 0) return void null
if (data.length === 0) return null
const {type, id} = data[0]
const { type, id } = data[0]
setCurrentWindowId(id)
setInputType(type)
},