mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Add GridBuffer placeholder
This commit is contained in:
parent
393b1f1dd6
commit
4747a3396c
2 changed files with 45 additions and 22 deletions
|
|
@ -33,7 +33,12 @@ const keyNames = {
|
|||
}
|
||||
/* eslint-enable */
|
||||
|
||||
export default function ({ currentWindow, inputType, sendMessage }) {
|
||||
export default function ({
|
||||
inputType,
|
||||
windows,
|
||||
currentWindowId,
|
||||
sendMessage
|
||||
}) {
|
||||
const [inputText, setInputText] = useState('')
|
||||
const [lastInput, setLastInput] = useState('')
|
||||
const inputEl = useRef(null)
|
||||
|
|
@ -43,9 +48,14 @@ export default function ({ currentWindow, inputType, sendMessage }) {
|
|||
inputEl.current && inputEl.current.focus()
|
||||
}, [inputType])
|
||||
|
||||
const send = x => {
|
||||
sendMessage(x, currentWindow)
|
||||
setLastInput(x)
|
||||
const send = message => {
|
||||
sendMessage(
|
||||
message,
|
||||
inputType,
|
||||
windows
|
||||
.find(({id}) =>
|
||||
id === currentWindowId))
|
||||
setLastInput(message)
|
||||
setInputText('')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue