@devries-cameron20 / t3code Mirror · read-only / commits / 196950a6e9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 06:45 UTC

perf(web): the provider update notification compiles without manual memoization (#20609)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:01 UTC 196950a6e9c1d6997e81e517e97e3de947968bc7
1 file changed +20 -29
apps/web/src/components/ProviderUpdatePrimaryNotification.tsx
+20 -29
@@ -1,7 +1,7 @@
1 import { useNavigate } from "@tanstack/react-router";
2 import { useAtomValue } from "@effect/atom-react";
3 import { DownloadIcon } from "lucide-react";
4 -import { useCallback, useEffect, useMemo, useRef } from "react";
4 +import { useEffect, useRef } from "react";
5 import {
6 AuthProvidersManageScope,
7 type ServerProvider,
@@ -126,36 +126,27 @@ export function ProviderUpdatePrimaryNotification() {
126 };
127 }, []);
128
129 - const updateProviders = useMemo(() => collectProviderUpdateCandidates(providers), [providers]);
130 - const notificationKey = useMemo(
131 - () => providerUpdateNotificationKey(updateProviders),
132 - [updateProviders],
133 - );
134 - const oneClickProviders = useMemo(
135 - () =>
136 - updateProviders.filter((provider) => canOneClickUpdateProviderCandidate(provider, providers)),
137 - [providers, updateProviders],
129 + const updateProviders = collectProviderUpdateCandidates(providers);
130 + const notificationKey = providerUpdateNotificationKey(updateProviders);
131 + const oneClickProviders = updateProviders.filter((provider) =>
132 + canOneClickUpdateProviderCandidate(provider, providers),
133 );
134
140 - const openProviderSettings = useCallback(
141 - (toastId?: ProviderUpdateToastId) => {
142 - const activeToast = activeToastRef.current;
143 - if (toastId !== undefined) {
144 - toastManager.close(toastId);
145 - } else if (activeToast?.kind === "prompt") {
146 - toastManager.close(activeToast.toastId);
147 - }
148 - if (
149 - activeToast &&
150 - (toastId === undefined ||
151 - (activeToast.kind === "prompt" && activeToast.toastId === toastId))
152 - ) {
153 - activeToastRef.current = null;
154 - }
155 - void navigate({ to: "/settings/providers" });
156 - },
157 - [navigate],
158 - );
135 + const openProviderSettings = (toastId?: ProviderUpdateToastId) => {
136 + const activeToast = activeToastRef.current;
137 + if (toastId !== undefined) {
138 + toastManager.close(toastId);
139 + } else if (activeToast?.kind === "prompt") {
140 + toastManager.close(activeToast.toastId);
141 + }
142 + if (
143 + activeToast &&
144 + (toastId === undefined || (activeToast.kind === "prompt" && activeToast.toastId === toastId))
145 + ) {
146 + activeToastRef.current = null;
147 + }
148 + void navigate({ to: "/settings/providers" });
149 + };
150
151 useEffect(() => {
152 const activeToast = activeToastRef.current;