Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix text confirmation modal not resetting input field (#26696)

Joshen Lim73d77a2fd823
diff --git a/apps/studio/localStores/storageExplorer/StorageExplorerStore.tsx b/apps/studio/localStores/storageExplorer/StorageExplorerStore.tsx
index cf949f3c6b3..4d67db79691 100644
--- a/apps/studio/localStores/storageExplorer/StorageExplorerStore.tsx
+++ b/apps/studio/localStores/storageExplorer/StorageExplorerStore.tsx
@@ -1141,7 +1141,7 @@ class StorageExplorerStore {
return col
})
} else if (!res.error.message.includes('aborted')) {
- toast.error(`Failed to retrieve folder contents from "${folderName}": ${res.error.message}`)
+ toast.error(`Failed to retrieve more folder contents: ${res.error.message}`)
}
}
diff --git a/packages/ui-patterns/Dialogs/TextConfirmModal.tsx b/packages/ui-patterns/Dialogs/TextConfirmModal.tsx
index d92dc39a8f4..65c59663b89 100644
--- a/packages/ui-patterns/Dialogs/TextConfirmModal.tsx
+++ b/packages/ui-patterns/Dialogs/TextConfirmModal.tsx
@@ -1,7 +1,7 @@
'use client'
import { zodResolver } from '@hookform/resolvers/zod'
-import { ReactNode, forwardRef } from 'react'
+import { ReactNode, forwardRef, useEffect } from 'react'
import { useForm } from 'react-hook-form'
import {
Admonition,
@@ -100,6 +100,10 @@ const TextConfirmModal = forwardRef<
onConfirm()
}
+ useEffect(() => {
+ if (confirmString) form.reset()
+ }, [confirmString])
+
return (
<Dialog
open={visible}