Skip to content

Commit 45508ac

Browse files
authored
Merge pull request #48 from dasuni-30/fix-pr-builder
fix(react): Fix EsLint issues in the PR builder
2 parents 5dbbff9 + f0bbb30 commit 45508ac

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.changeset/spicy-lies-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@asgardeo/react': patch
3+
---
4+
5+
Fix EsLint issues in the PR build failure

packages/react/src/components/SignIn/SignIn.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
8282
const {config} = useConfig();
8383

8484
const authContext: AuthContext | undefined = useContext(AsgardeoContext);
85+
const {setAuthResponse, setIsComponentLoading} = authContext;
8586
const brandingPreference: Branding = useContext(BrandingPreferenceContext);
8687

8788
const {isLoading, t} = useTranslations({
@@ -102,16 +103,16 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
102103
*/
103104
authorize()
104105
.then((response: AuthApiResponse) => {
105-
authContext?.setAuthResponse(response);
106+
setAuthResponse(response);
106107
})
107108
.catch((error: Error) => {
108109
setAlert({alertType: {error: true}, key: keys.common.error});
109110
throw new AsgardeoUIException('REACT_UI-SIGN_IN-SI-SE01', 'Authorization failed', error.stack);
110111
})
111112
.finally(() => {
112-
authContext?.setIsComponentLoading(false);
113+
setIsComponentLoading(false);
113114
});
114-
}, []);
115+
}, [setAuthResponse, setIsComponentLoading]);
115116

116117
/**
117118
* Handles the generalized authentication process.

packages/react/src/hooks/use-on.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const useOn = (props: UseOnProps): void => {
3838
default:
3939
throw new AsgardeoUIException('REACT-USE_ON-UO-IV-01', 'Invalid event type provided.');
4040
}
41-
}, []);
41+
}, [callback, contextValue, event]);
4242
};
4343

4444
export default useOn;

packages/react/src/hooks/use-translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ const useTranslations = (props: SetTranslationsProps): UseTranslations => {
4949
setIsLoading(!response);
5050
setIsTextLoading(!response);
5151
});
52-
}, [componentLocaleOverride, componentTextOverrides, screen, setTranslations]);
52+
}, [componentLocaleOverride, componentTextOverrides, screen, setIsTextLoading, setTranslations]);
5353

5454
useEffect(() => {
5555
setIsTextLoading(isLoading);
56-
}, [isLoading]);
56+
}, [isLoading, setIsTextLoading]);
5757

5858
/**
5959
* `t` is a function that retrieves a specific translation from the fetched translations.

0 commit comments

Comments
 (0)