Skip to content

Commit 557981e

Browse files
ORV2-5101: Fix inconsistent hook order in AmendPermit (#2180)
1 parent ccedfb6 commit 557981e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/features/permits/pages/Amend/AmendPermit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const searchRoute =
8282

8383
export const AmendPermit = () => {
8484
const { permitId: permitIdParam, companyId: companyIdParam } = useParams();
85-
85+
const { idirUserDetails } = useContext(OnRouteBCContext);
8686
const { state: stateFromNavigation } = useLocation();
8787

8888
const companyId: number = applyWhenNotNullable(
@@ -221,11 +221,11 @@ export const AmendPermit = () => {
221221
],
222222
);
223223

224+
224225
if (isLoadingState()) {
225226
return <Loading />;
226227
}
227228

228-
const { idirUserDetails } = useContext(OnRouteBCContext);
229229

230230
// unable to use permission matrix in this component, using manual role check instead
231231
const canAmendPermit = (role?: string) => {

0 commit comments

Comments
 (0)