fix: Reflect task lists expansion instantly after switching setting
This commit is contained in:
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { Progress } from 'semantic-ui-react';
|
import { Progress } from 'semantic-ui-react';
|
||||||
import { useToggle } from '../../../../lib/hooks';
|
import { useDidUpdate, useToggle } from '../../../../lib/hooks';
|
||||||
|
|
||||||
import selectors from '../../../../selectors';
|
import selectors from '../../../../selectors';
|
||||||
import Task from './Task';
|
import Task from './Task';
|
||||||
@@ -51,6 +51,10 @@ const TaskList = React.memo(({ id }) => {
|
|||||||
[toggleOpened, filteredTasks.length],
|
[toggleOpened, filteredTasks.length],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useDidUpdate(() => {
|
||||||
|
toggleOpened();
|
||||||
|
}, [defaultIsOpened]);
|
||||||
|
|
||||||
if (tasks.length === 0) {
|
if (tasks.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user