Skip to content

Commit

Permalink
chore: enhance tree shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Mar 4, 2022
1 parent 2d7c293 commit 1cb07a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/Settings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Header, SwitchField, SegmentedControlField, TimeField, PasswordField, W
import { defaultLogsSettings } from 'helpers/logger';
import { defaultTimerSettings } from 'helpers/timer';
import { version } from '../../../package.json';
import _ from 'lodash';
import { set, cloneDeep } from 'lodash';
import './styles.scss';

export class Settings extends Component {
Expand Down Expand Up @@ -243,7 +243,7 @@ export class Settings extends Component {
});
break;
case 2:
const options = _.set(this.state.options, params[0], params[1]);
const options = set(this.state.options, params[0], params[1]);
this.setState({ options });
break;
}
Expand Down Expand Up @@ -340,7 +340,7 @@ export class Settings extends Component {
'schedule.days',
DaysOfWeek.reduce((acc, cur) => ({
...acc,
[cur]: _.cloneDeep(this.state.options.schedule.days[this.state.selectedScheduleDay]),
[cur]: cloneDeep(this.state.options.schedule.days[this.state.selectedScheduleDay]),
}), {})
);
this.closeDialog();
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/AnimatedIconButton/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { Component } from 'react';
import { debug } from 'helpers/debug';
import { IconButton } from 'components';
import _ from 'lodash';
import { isBoolean } from 'lodash';
import './styles.scss';

export class AnimatedIconButton extends Component {

constructor(props) {
super(props);
this.state = {
isVisible: _.isBoolean(this.props.isVisible) ? this.props.isVisible : true, // do not use || operator with boolean values that takes "true" by default
isVisible: isBoolean(this.props.isVisible) ? this.props.isVisible : true, // do not use || operator with boolean values that takes "true" by default
className: '',
icon: this.props.icon,
iconColor: this.props.iconColor,
Expand Down

0 comments on commit 1cb07a6

Please sign in to comment.