Changesets · Branches · Tags · Compare
| Changeset | 6b5cbdc994571cf57a98896a280fb40cd06a1b107752d6b83b2d765f428b0b14 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-09 17:38 -07:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-09-09 17:38 -07:00 |
| Parents | 221eadff5fd2 |
1 file changed
modified gui/src/pages/config/features/account/AccountDropdown.tsx +1 −31
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | } from "@heroicons/react/24/outline"; |
| 6 | 6 | import { UserCircleIcon as UserCircleIconSolid } from "@heroicons/react/24/solid"; |
| 7 | 7 | import { isOnPremSession } from "core/control-plane/AuthTypes"; |
| 8 | -import { useContext, useEffect } from "react"; | |
| 8 | +import { useContext } from "react"; | |
| 9 | 9 | import { ToolTip } from "../../../../components/gui/Tooltip"; |
| 10 | 10 | import { |
| 11 | 11 | Button, |
| @@ -18,40 +18,10 @@ | ||
| 18 | 18 | import { useAuth } from "../../../../context/Auth"; |
| 19 | 19 | import { IdeMessengerContext } from "../../../../context/IdeMessenger"; |
| 20 | 20 | |
| 21 | -interface FreeTrialStatus { | |
| 22 | - optedInToFreeTrial: boolean; | |
| 23 | - chatCount?: number; | |
| 24 | - autocompleteCount?: number; | |
| 25 | - chatLimit: number; | |
| 26 | - autocompleteLimit: number; | |
| 27 | -} | |
| 28 | - | |
| 29 | 21 | export function AccountDropdown() { |
| 30 | 22 | const { session, logout, login } = useAuth(); |
| 31 | 23 | const ideMessenger = useContext(IdeMessengerContext); |
| 32 | 24 | |
| 33 | - useEffect(() => { | |
| 34 | - const fetchFreeTrialStatus = async () => { | |
| 35 | - if (session && !isOnPremSession(session)) { | |
| 36 | - try { | |
| 37 | - const response = await ideMessenger.request( | |
| 38 | - "controlPlane/getFreeTrialStatus", | |
| 39 | - undefined, | |
| 40 | - ); | |
| 41 | - if (response.status === "success") { | |
| 42 | - setFreeTrialStatus(response.content); | |
| 43 | - } else { | |
| 44 | - console.error("Failed to fetch free trial status:", response.error); | |
| 45 | - } | |
| 46 | - } catch (error) { | |
| 47 | - console.error("Failed to fetch free trial status:", error); | |
| 48 | - } | |
| 49 | - } | |
| 50 | - }; | |
| 51 | - | |
| 52 | - void fetchFreeTrialStatus(); | |
| 53 | - }, [session, ideMessenger]); | |
| 54 | - | |
| 55 | 25 | if (isOnPremSession(session)) { |
| 56 | 26 | return null; |
| 57 | 27 | } |