Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit a968091

Browse files
Hubert KosterHubert Koster
authored andcommitted
chore: improve code efficiency
1 parent a74d492 commit a968091

File tree

1 file changed

+2
-1
lines changed
  • src/features/Apiexplorer/SubscribeRenderer

1 file changed

+2
-1
lines changed

src/features/Apiexplorer/SubscribeRenderer/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function SubscribeRenderer<T extends TSocketSubscribableEndpointNames>({
4444
}, [is_subscribed]);
4545

4646
useEffect(() => {
47-
if (!is_authorized) unsubscribe();
47+
const has_active_subscription = full_response !== undefined && !is_authorized;
48+
if (has_active_subscription) unsubscribe();
4849
}, [is_authorized]);
4950

5051
const parseRequestJSON = useCallback(() => {

0 commit comments

Comments
 (0)