Skip to content

Commit

Permalink
Add nullsafety to the deletedStep state filter check (#1047)
Browse files Browse the repository at this point in the history
* feat: refactor legal form implementation

* test: add unit test

* refact: display the first LegalName and set default value from basic data

* fix: clean up

* refact: add formProvider to the others step to be able to work on trixo

* refact: trixo improvement

* test: add trixo integration test

* fix: review legal form

* refactor/wip: still working on certificate step label component

* refactor: improve stepper label

* refactor: make the step label clickable

* fix: update copy

* fix/wip: register endpoint should not be call on login

* fix: reset modal

* skip test

* fix: review modal state issue

* fix: review clear all form

* refact: reset state after clear all form

* fix: modal copy

* skip test

* fix: delete register endpoint  params

* refactor: set initial state at the overview page

* refactor: create a separate hook for file upload with the new request

* refact/wip: improve data fetching

* fix: highlight certificate label issue

* fix conflict

* refactor: reset form after clear button action & update delete request endpoint url

* refactor: set current step status to progress

* improve basic detail

* refactor: hard coded page reload

* clean up

* add reload for fail uploaded file

* minor fix

* add default state

* add nullsafety

* clean up
  • Loading branch information
masskoder authored Jun 1, 2023
1 parent 3fd1fcd commit d70b427
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/gds-user-ui/src/hooks/useCertificateStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@ const useCertificateStepper = () => {
};

const isStepDeleted = (step: string) => {
const elm = Store.getState().stepper.deletedSteps;
const found = elm.filter((s: TDeleteStep) => s.step === step && s.isDeleted === true);
return found.length > 0;
const elm = Store.getState()?.stepper?.deletedSteps;
if (!elm) return false;
const found = elm?.filter((s: TDeleteStep) => s.step === step && s.isDeleted === true);
return found?.length > 0;
};

return {
Expand Down

0 comments on commit d70b427

Please sign in to comment.