mirror of https://github.com/kortix-ai/suna.git
refactor(billing): update billing modal state management in MessageInput and ModelSelector components
This commit is contained in:
parent
7b10ca6478
commit
f22433332b
|
@ -183,7 +183,8 @@ export const MessageInput = forwardRef<HTMLTextAreaElement, MessageInputProps>(
|
|||
subscriptionStatus={subscriptionStatus}
|
||||
canAccessModel={canAccessModel}
|
||||
refreshCustomModels={refreshCustomModels}
|
||||
billingModalOpenParent={billingModalOpen}
|
||||
billingModalOpen={billingModalOpen}
|
||||
setBillingModalOpen={setBillingModalOpen}
|
||||
/>
|
||||
) : (
|
||||
<ChatSettingsDropdown
|
||||
|
|
|
@ -46,7 +46,8 @@ interface ModelSelectorProps {
|
|||
canAccessModel: (modelId: string) => boolean;
|
||||
subscriptionStatus: SubscriptionStatus;
|
||||
refreshCustomModels?: () => void;
|
||||
billingModalOpenParent: boolean;
|
||||
billingModalOpen: boolean;
|
||||
setBillingModalOpen: (open: boolean) => void;
|
||||
hasBorder?: boolean;
|
||||
}
|
||||
|
||||
|
@ -57,11 +58,11 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|||
canAccessModel,
|
||||
subscriptionStatus,
|
||||
refreshCustomModels,
|
||||
billingModalOpenParent,
|
||||
billingModalOpen,
|
||||
setBillingModalOpen,
|
||||
hasBorder = false,
|
||||
}) => {
|
||||
const [paywallOpen, setPaywallOpen] = useState(false);
|
||||
const [billingModalOpen, setBillingModalOpen] = useState(billingModalOpenParent);
|
||||
const [lockedModel, setLockedModel] = useState<string | null>(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
|
@ -83,10 +84,6 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setBillingModalOpen(billingModalOpenParent);
|
||||
}, [billingModalOpenParent]);
|
||||
|
||||
// Save custom models to localStorage whenever they change
|
||||
useEffect(() => {
|
||||
if (isLocalMode() && customModels.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue