state debug
This commit is contained in:
parent
70e1e156a6
commit
2f1a60fce7
|
@ -14,11 +14,21 @@ import {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
const selectWindowIds = (state) => state.windows.windows.map((win) => win.windowId);
|
const selectWindowIds = (state) => state.windows.windows.map((win) => win.windowId);
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
const selectMeta = (state) => [state.windows.showWindows, state.windows.someFullscreen];
|
const selectMeta = (state) => {
|
||||||
|
console.log('check');
|
||||||
|
return [
|
||||||
|
state.windows.showWindows,
|
||||||
|
state.windows.someFullscreen,
|
||||||
|
state.windows.windows.some((win) => win.fullscreen && win.open && !win.hidden),
|
||||||
|
]};
|
||||||
|
|
||||||
const WindowManager = () => {
|
const WindowManager = () => {
|
||||||
const windowIds = useSelector(selectWindowIds, shallowEqual);
|
const windowIds = useSelector(selectWindowIds, shallowEqual);
|
||||||
const [showWindows, someFullscreen] = useSelector(selectMeta, shallowEqual);
|
const [
|
||||||
|
showWindows,
|
||||||
|
someFullscreen,
|
||||||
|
someOpenFullscreen,
|
||||||
|
] = useSelector(selectMeta, shallowEqual);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
if ((!showWindows && !someFullscreen) || !windowIds.length) {
|
if ((!showWindows && !someFullscreen) || !windowIds.length) {
|
||||||
|
@ -28,7 +38,7 @@ const WindowManager = () => {
|
||||||
return (
|
return (
|
||||||
<div id="wm">
|
<div id="wm">
|
||||||
<Overlay
|
<Overlay
|
||||||
show={someFullscreen}
|
show={someOpenFullscreen}
|
||||||
onClick={() => dispatch(closeFullscreenWindows())}
|
onClick={() => dispatch(closeFullscreenWindows())}
|
||||||
/>
|
/>
|
||||||
{windowIds.map((id) => <Window key={id} id={id} />)}
|
{windowIds.map((id) => <Window key={id} id={id} />)}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user