ui: make modals auto-close (#1879)
This commit is contained in:
@@ -108,7 +108,12 @@ export default function ExtensionModal({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<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"
|
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
|
<Trash2 className="h-4 w-4 mr-2" /> Confirm Delete
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export const AddModelModal = ({ onClose, setView }: AddModelModalProps) => {
|
|||||||
|
|
||||||
const changeModel = async () => {
|
const changeModel = async () => {
|
||||||
await switchModel({ model: model, provider: provider, writeToConfig: upsert });
|
await switchModel({ model: model, provider: provider, writeToConfig: upsert });
|
||||||
|
onClose(); // Add this line to close the modal after changing the model
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user