Skip to content

Commit

Permalink
fix: reset selected CR/item after CR action (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
strogonoff committed Sep 9, 2020
1 parent a3c72cc commit 6d52600
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/renderer/home/modules/review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ const CRDetailsPanel: React.FC<{}> = function () {
const committerEmail = useIPCValue<{}, { email: string }>
('db-default-get-current-committer-info', { email: '' }).value.email;

const crID = useContext(ChangeRequestContext).selected;
const crCtx = useContext(ChangeRequestContext);
const crID = crCtx.selected;

const cr = app.useOne<ChangeRequest, string>('changeRequests', crID || null).object;

const [stageInProgress, setStageInProgress] = useState<boolean>(false);

const ctx = useContext(ConceptContext);
const userIsManager = useContext(UserRoleContext).isManager === true;

const revealButtonHelpRef = useHelp('file-reveal-button');
Expand Down Expand Up @@ -373,6 +375,9 @@ const CRDetailsPanel: React.FC<{}> = function () {
('model-changeRequests-update-stage', { changeRequestID: crID, newStage });

setStageInProgress(false);

ctx.select(null);
crCtx.select(null);
}

return (
Expand Down

0 comments on commit 6d52600

Please sign in to comment.