Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* for visual consistency across account tabs.
*/

import React, { useState, useCallback } from 'react';
import React, { useState, useCallback, useMemo } from 'react';
import type { CSSProperties } from 'react';
import { commonStyles } from '../../../themes/styles';
import type { BillingDetail, CreditBalance, TransactionsResult, UsageRollup } from '../../billing/types';
Expand Down Expand Up @@ -198,7 +198,7 @@ export const BillingPanel: React.FC<BillingPanelProps> = ({ isConnected, subscri
const isSubscribed = subscriptions.length > 0;
const handleAddCapacity = useCallback(() => setShowTopUpModal(true), []);
// Build appId → app lookup for display name resolution
const appMap = React.useMemo(() => {
const appMap = useMemo(() => {
const map: Record<string, { id: string; name: string; icon?: string; description?: string }> = {};
for (const a of apps ?? []) map[a.id] = a;
return map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* the host via callback props.
*/

import React from 'react';
import React, { useState, useEffect } from 'react';
import type { CSSProperties } from 'react';
import { commonStyles } from '../../../themes/styles';
import type { ConnectResult, ProfileUpdate } from '../types';
Expand Down Expand Up @@ -90,13 +90,13 @@ export const ProfilePanel: React.FC<ProfilePanelProps> = ({ profile, authUser, o
locale: profile?.locale || authUser?.locale || '',
});

const [editOpen, setEditOpen] = React.useState(false);
const [fields, setFields] = React.useState<ProfileUpdate>(fromProfile);
const [saving, setSaving] = React.useState(false);
const [error, setError] = React.useState<string | null>(null);
const [editOpen, setEditOpen] = useState(false);
const [fields, setFields] = useState<ProfileUpdate>(fromProfile);
const [saving, setSaving] = useState(false);
const [error, setError] = useState<string | null>(null);

// Re-sync form fields when the server profile or auth user data is refreshed.
React.useEffect(() => {
useEffect(() => {
setFields(fromProfile());
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [profile?.displayName, profile?.email, authUser?.email]);
Expand Down
Loading