Skip to content

Commit 3abace8

Browse files
committed
fix: Do not restart the language client when getSecurityToken changes
1 parent 425b73c commit 3abace8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/LanguageClient.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ function LanguageClient ({
3030
sessionId,
3131
languageServerUrl,
3232
useMutualizedProxy,
33-
getSecurityToken,
33+
getSecurityToken: _getSecurityToken,
3434
libraryUrls = defaultLibraryUrls,
3535
onError: _onError,
3636
onDidChangeStatus: _onDidChangeStatus,
3737
onWillShutdown: _onWillShutdown,
3838
userInactivityDelay = 30 * 1000,
3939
userInactivityShutdownDelay = 60 * 1000
4040
}: LanguageClientProps): ReactElement | null {
41+
const getSecurityToken = useLastVersion(_getSecurityToken)
4142
const onError = useLastVersion(_onError ?? noop)
4243
const onDidChangeStatus = useLastVersion(_onDidChangeStatus ?? noop)
4344
const onWillShutdown = useLastVersion(_onWillShutdown ?? noop)

0 commit comments

Comments
 (0)