浏览代码

fix: reset delete confirm values after success (#268)

Reset delete confirm input values after successful mutations in table bulk actions.
Sat Naing 6 月之前
父节点
当前提交
d86ee05a06

+ 1 - 0
src/features/tasks/components/tasks-multi-delete-dialog.tsx

@@ -38,6 +38,7 @@ export function TasksMultiDeleteDialog<TData>({
     toast.promise(sleep(2000), {
       loading: 'Deleting tasks...',
       success: () => {
+        setValue('')
         table.resetRowSelection()
         return `Deleted ${selectedRows.length} ${
           selectedRows.length > 1 ? 'tasks' : 'task'

+ 1 - 0
src/features/users/components/users-multi-delete-dialog.tsx

@@ -38,6 +38,7 @@ export function UsersMultiDeleteDialog<TData>({
     toast.promise(sleep(2000), {
       loading: 'Deleting users...',
       success: () => {
+        setValue('')
         table.resetRowSelection()
         return `Deleted ${selectedRows.length} ${
           selectedRows.length > 1 ? 'users' : 'user'