Skip to content

Commit aa2febb

Browse files
perf(web): the CLI authorize surface compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit aa2febb

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/components/cloud/ConnectCliAuthSurface.tsx",
99100
] as const;

‎apps/web/src/components/cloud/ConnectCliAuthSurface.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useAuth, useClerk } from "@clerk/react";
22
import { readConnectAuthorizeRequest } from "@t3tools/shared/connectAuth";
3-
import { useCallback, useEffect, useRef, useState } from "react";
3+
import { useEffect, useEffectEvent, useRef, useState } from "react";
44

55
import {
66
buildConnectCliClerkAuthorizeUrl,
@@ -45,7 +45,7 @@ export function ConnectCliAuthorizeSurface() {
4545
const signInOpened = useRef(false);
4646
const redirecting = useRef(false);
4747

48-
const openSignIn = useCallback(() => {
48+
const openSignIn = () => {
4949
if (!request) {
5050
return;
5151
}
@@ -55,7 +55,8 @@ export function ConnectCliAuthorizeSurface() {
5555
isElectron,
5656
),
5757
);
58-
}, [clerk, request]);
58+
};
59+
const openSignInOnLoad = useEffectEvent(openSignIn);
5960

6061
useEffect(() => {
6162
if (!request || !isLoaded || redirecting.current) {
@@ -64,7 +65,7 @@ export function ConnectCliAuthorizeSurface() {
6465
if (!isSignedIn) {
6566
if (!signInOpened.current) {
6667
signInOpened.current = true;
67-
openSignIn();
68+
openSignInOnLoad();
6869
}
6970
return;
7071
}
@@ -74,7 +75,7 @@ export function ConnectCliAuthorizeSurface() {
7475
}
7576
redirecting.current = true;
7677
window.location.assign(authorizeUrl);
77-
}, [isLoaded, isSignedIn, openSignIn, request]);
78+
}, [isLoaded, isSignedIn, request]);
7879

7980
if (!request) {
8081
return (

0 commit comments

Comments
 (0)