@@ -23,15 +23,13 @@ import { fetchMutation, getKey, useMutationWrapper } from "@/features/backend";
2323import type { MessageResponse } from "@/features/backend/types" ;
2424import { GrammaticalCase , declineNoun } from "@/features/polish" ;
2525import type { Resource } from "@/features/resources" ;
26- import type { ResourcePk } from "@/features/resources/types" ;
2726import { useRouter } from "@/hooks/use-router" ;
2827import { getToastMessages } from "@/lib/get-toast-messages" ;
2928import type { OptionalPromise } from "@/types/helpers" ;
3029import { quoteText } from "@/utils" ;
3130
3231export function ArcHideButtonWithDialog ( {
3332 resource,
34- id,
3533 googleCalId,
3634 hidden,
3735 itemName,
@@ -40,7 +38,6 @@ export function ArcHideButtonWithDialog({
4038 ...props
4139} : {
4240 resource : Resource ;
43- id : ResourcePk ;
4441 googleCalId : string ;
4542 hidden : boolean ;
4643 itemName ?: string ;
@@ -50,7 +47,7 @@ export function ArcHideButtonWithDialog({
5047 const [ isAlertDialogOpen , setIsAlertDialogOpen ] = useState ( false ) ;
5148 const router = useRouter ( ) ;
5249 const queryClient = useQueryClient ( ) ;
53- const { mutateAsync, isPending, isSuccess } = useMutationWrapper <
50+ const { mutateAsync, isPending } = useMutationWrapper <
5451 MessageResponse ,
5552 string
5653 > ( getKey . mutation . hideResource ( resource , googleCalId ) , async ( calId ) => {
@@ -96,7 +93,11 @@ export function ArcHideButtonWithDialog({
9693 { hidden ? < Eye /> : < EyeOff /> }
9794 </ Button >
9895 </ AlertDialogTrigger >
99- < AlertDialogContent >
96+ < AlertDialogContent
97+ onCloseAutoFocus = { ( event ) => {
98+ event . preventDefault ( ) ;
99+ } }
100+ >
100101 < AlertDialogHeader >
101102 < AlertDialogTitle className = "text-balance" >
102103 { hidden
@@ -125,7 +126,6 @@ export function ArcHideButtonWithDialog({
125126 variant = "destructive"
126127 onClick = { handleHide }
127128 loading = { isPending }
128- disabled = { isSuccess }
129129 >
130130 { hidden ? (
131131 < >
0 commit comments