refactored rerendering speed

This commit is contained in:
Fedor Katurov 2020-01-16 11:49:24 +07:00
parent b6bf317649
commit 69d1d749cf
32 changed files with 144 additions and 2045 deletions

View file

@ -32,20 +32,11 @@ const mapStateToProps = ({
user: { role },
},
}: IState) => {
if (routes.filter.max >= 9999) {
return {
routes,
editing,
ready: false,
role,
};
}
return {
role,
routes,
editing,
ready: true,
ready: routes.filter.max < 9999,
};
};

View file

@ -89,18 +89,17 @@ const mapDispatchToProps = {
editorRouterSubmit: EDITOR_ACTIONS.editorRouterSubmit,
};
type Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & { };
type Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
const RouterDialogUnconnected: FC<Props> = ({
editor: {
router: { waypoints },
is_routing,
},
editorRouterCancel,
editorRouterSubmit,
}) => (
<div className="control-dialog bottom right">
<div className={classnames('save-loader', { active: is_routing })} />
<div className={classnames('save-loader')} />
{!waypoints.length && noPoints({ editorRouterCancel })}
{waypoints.length === 1 && firstPoint({ editorRouterCancel })}