mirror of
https://github.com/pommee/goaway.git
synced 2026-01-11 16:40:32 -06:00
ui: add missing close handler to cancel button on PauseBlockingDialog
This commit is contained in:
@@ -143,7 +143,11 @@ function CheckForUpdate() {
|
||||
});
|
||||
}
|
||||
|
||||
export default function PauseBlockingDialog() {
|
||||
export default function PauseBlockingDialog({
|
||||
onClose
|
||||
}: {
|
||||
onClose: () => void;
|
||||
}) {
|
||||
type PausedResponse = {
|
||||
paused: boolean;
|
||||
timeLeft: number;
|
||||
@@ -268,7 +272,11 @@ export default function PauseBlockingDialog() {
|
||||
</div>
|
||||
|
||||
<DialogFooter className="flex justify-end gap-2">
|
||||
<Button variant="outline" className="border-gray-300">
|
||||
<Button
|
||||
variant="outline"
|
||||
className="border-gray-300"
|
||||
onClick={onClose}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
@@ -299,9 +307,13 @@ export default function PauseBlockingDialog() {
|
||||
export function NavActions() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [DialogComponent, setDialogComponent] = useState<
|
||||
null | (() => JSX.Element)
|
||||
null | ((props: { onClose: () => void }) => JSX.Element)
|
||||
>(null);
|
||||
|
||||
const closeDialog = () => {
|
||||
setDialogComponent(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
||||
@@ -354,7 +366,7 @@ export function NavActions() {
|
||||
if (!open) setDialogComponent(null);
|
||||
}}
|
||||
>
|
||||
<DialogComponent />
|
||||
<DialogComponent onClose={closeDialog} />
|
||||
</Dialog>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user