From f212cb2b408c51fe07c946b8f89f2776aa1cdbfc Mon Sep 17 00:00:00 2001 From: Jack Chen Date: Fri, 25 Sep 2020 15:39:26 -0700 Subject: [PATCH] fix(discoverability): use init instead of cancel --- src/region/RegionAnnotations.tsx | 2 +- src/region/__tests__/RegionAnnotations-test.tsx | 2 +- src/store/creator/types.ts | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/region/RegionAnnotations.tsx b/src/region/RegionAnnotations.tsx index 4452ad444..d4df6c425 100644 --- a/src/region/RegionAnnotations.tsx +++ b/src/region/RegionAnnotations.tsx @@ -61,7 +61,7 @@ export default class RegionAnnotations extends React.PureComponent 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 => { diff --git a/src/region/__tests__/RegionAnnotations-test.tsx b/src/region/__tests__/RegionAnnotations-test.tsx index 921817e98..994e08990 100644 --- a/src/region/__tests__/RegionAnnotations-test.tsx +++ b/src/region/__tests__/RegionAnnotations-test.tsx @@ -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 }) => { diff --git a/src/store/creator/types.ts b/src/store/creator/types.ts index bcee8f05c..0ce619649 100644 --- a/src/store/creator/types.ts +++ b/src/store/creator/types.ts @@ -1,7 +1,6 @@ import { Rect, SerializedError, Shape } from '../../@types'; export enum CreatorStatus { - cancel = 'cancel', init = 'init', pending = 'pending', rejected = 'rejected',