Skip to content

Commit

Permalink
fix: add biome-ignore to hooks that work as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
unrenamed committed Nov 15, 2024
1 parent b21b1c4 commit c6408fc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export const CreateKey: React.FC<Props> = ({ apiId, keyAuthId, defaultBytes, def
form.resetField("limit", undefined);
};

// biome-ignore lint/correctness/useExhaustiveDependencies: reset is only required on mount
useEffect(() => {
// React hook form + zod doesn't play nice with nested objects, so we need to reset them on load.
resetRateLimit();
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/app/(app)/settings/root-keys/new/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const Client: React.FC<Props> = ({ apis }) => {
}));
};

// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once to set initial cards state
useEffect(() => {
const initialSelectedApiSet = new Set<string>();
selectedPermissions.forEach((permission) => {
Expand Down
5 changes: 3 additions & 2 deletions apps/dashboard/app/auth/sign-in/email-signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ export function EmailSignIn(props: {
const router = useRouter();
const [lastUsed, setLastUsed] = useLastUsed();

// biome-igmore lint: this works
// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once if sign-in is loaded
React.useEffect(() => {
const signUpOrgUser = async () => {
const ticket = new URL(window.location.href).searchParams.get(param);
if (!signInLoaded) {
return;
}

const ticket = new URL(window.location.href).searchParams.get(param);
if (!ticket) {
return;
}
Expand Down
7 changes: 7 additions & 0 deletions apps/dashboard/app/auth/sign-up/email-signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ export const EmailSignUp: React.FC<Props> = ({ setError, setVerification }) => {
const [isLoading, setIsLoading] = React.useState(false);
const [_transferLoading, setTransferLoading] = React.useState(true);
const router = useRouter();

// biome-ignore lint/correctness/useExhaustiveDependencies: effect must be called once if sign-up is loaded
React.useEffect(() => {
const signUpFromParams = async () => {
if (!signUpLoaded) {
return;
}

const ticket = new URL(window.location.href).searchParams.get("__clerk_ticket");
const emailParam = new URL(window.location.href).searchParams.get("email");
if (!ticket && !emailParam) {
Expand Down Expand Up @@ -68,6 +74,7 @@ export const EmailSignUp: React.FC<Props> = ({ setError, setVerification }) => {
});
}
};

signUpFromParams();
setTransferLoading(false);
}, [signUpLoaded]);
Expand Down

0 comments on commit c6408fc

Please sign in to comment.