Unified · Split
| @@ -42,15 +42,8 @@ function useInitialProviderVisibleAfterIso( · 41 unmodified lines | ||
| 42 | 42 | providers: ReadonlyArray<Pick<ServerProvider, "checkedAt">>, |
| 43 | 43 | ): string | undefined { |
| 44 | 44 | const latestCheckedAt = latestProviderCheckedAt(providers); |
| 45 | − const [visibleAfterIso, setVisibleAfterIso] = useState<string | undefined>(() => latestCheckedAt); | |
| 46 | − | |
| 47 | − useEffect(() => { | |
| 48 | − if (visibleAfterIso === undefined && latestCheckedAt !== undefined) { | |
| 49 | − setVisibleAfterIso(latestCheckedAt); | |
| 50 | − } | |
| 51 | − }, [latestCheckedAt, visibleAfterIso]); | |
| 52 | − | |
| 53 | − return visibleAfterIso ?? latestCheckedAt; | |
| 45 | + const [initialVisibleAfterIso] = useState<string | undefined>(() => latestCheckedAt); | |
| 46 | + return initialVisibleAfterIso ?? latestCheckedAt; | |
| 54 | 47 | } |
| 55 | 48 | |
| 56 | 49 | function useProviderUpdatePillTransition(view: ProviderUpdateSidebarPillView | null) { |