Skip to content

Commit

Permalink
fix(discoverability): use init instead of cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenCodes committed Sep 28, 2020
1 parent bbb67e5 commit f212cb2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/region/RegionAnnotations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class RegionAnnotations extends React.PureComponent<Props, State>
const { location, setStaged, setStatus } = this.props;

setStaged(shape ? { location, shape } : null);
setStatus(shape ? CreatorStatus.staged : CreatorStatus.cancel);
setStatus(shape ? CreatorStatus.staged : CreatorStatus.init);
};

renderCreator = (): JSX.Element => {
Expand Down
2 changes: 1 addition & 1 deletion src/region/__tests__/RegionAnnotations-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('RegionAnnotations', () => {
test.each`
shape | expectedStagedParam | expectedStatusParam
${definedShape} | ${{ location: defaults.location, shape: definedShape }} | ${CreatorStatus.staged}
${null} | ${null} | ${CreatorStatus.cancel}
${null} | ${null} | ${CreatorStatus.init}
`(
'should update the staged status if the shape is $shape',
({ expectedStagedParam, expectedStatusParam, shape }) => {
Expand Down
1 change: 0 additions & 1 deletion src/store/creator/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Rect, SerializedError, Shape } from '../../@types';

export enum CreatorStatus {
cancel = 'cancel',
init = 'init',
pending = 'pending',
rejected = 'rejected',
Expand Down

0 comments on commit f212cb2

Please sign in to comment.