ui: make modals auto-close (#1879)

This commit is contained in:
Lily Delalande
2025-03-27 10:43:09 -04:00
committed by GitHub
parent 080b08e7be
commit e58ccf3d37
2 changed files with 7 additions and 1 deletions

View File

@@ -108,7 +108,12 @@ export default function ExtensionModal({
</p>
</div>
<Button
onClick={() => onDelete && onDelete(formData.name)}
onClick={() => {
if (onDelete) {
onDelete(formData.name);
onClose(); // Add this line to close the modal after deletion
}
}}
className="w-full h-[60px] rounded-none border-b border-borderSubtle bg-transparent hover:bg-red-900/20 text-red-500 font-medium text-md"
>
<Trash2 className="h-4 w-4 mr-2" /> Confirm Delete

View File

@@ -45,6 +45,7 @@ export const AddModelModal = ({ onClose, setView }: AddModelModalProps) => {
const changeModel = async () => {
await switchModel({ model: model, provider: provider, writeToConfig: upsert });
onClose(); // Add this line to close the modal after changing the model
};
useEffect(() => {