From fae4b0948319a85c1800546bea657f6b282d4e6d Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 19 Jul 2021 16:25:36 +0500 Subject: [PATCH] Player: group all output windows --- src/components/Player/Player.jsx | 15 ++++++++++++--- src/components/Player/player.css | 14 +++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/components/Player/Player.jsx b/src/components/Player/Player.jsx index e72695d..b209374 100644 --- a/src/components/Player/Player.jsx +++ b/src/components/Player/Player.jsx @@ -42,7 +42,10 @@ const Handlers = ({ onUpdateWindows: windows => { setWindows(windows) }, - onUpdateInputs: ([{type, id}]) => { + onUpdateInputs: data => { + if (data.length === 0) return void null + + const {type, id} = data[0] setCurrentWindowId(id) setInputType(type) }, @@ -111,12 +114,18 @@ export default function ({ vmParts: { file, engine } }) { })[currentWindow.type] } + const byTop = (a, b) => + a.top - b.top + return status.stage !== 'ready' ? () : (
- { windows +
{ + windows + .sort(byTop) // .filter(({id}) => id === currentWindowId) - .map(textWindow(inbox)) } + .map(textWindow(inbox))} +
br:first-child,