mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: close dialog on close
This commit is contained in:
1 parent
3293afba76
commit
a5aad61cb7
1 file changed
+4
-3
@@ -18,7 +18,6 @@ import { debounce } from 'lodash-es';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { stringify } from 'urlon';
|
||||
import type { configurations } from '../../constants/embeds';
|
||||
import { App } from '../../stores/app';
|
||||
import { EmbedState, type EmbedStateStore } from '../../stores/embedState';
|
||||
import { CopyButton } from '../CopyButton';
|
||||
|
||||
@@ -27,7 +26,7 @@ interface CopyURLProps {
|
||||
}
|
||||
|
||||
export function CopyURL({ embed }: CopyURLProps) {
|
||||
const appStore = App.useStore();
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const embedStateStore = EmbedState.useStore();
|
||||
const input = useRef<HTMLInputElement>(null);
|
||||
const [searching, setSearching] = useState(false);
|
||||
@@ -65,7 +64,7 @@ export function CopyURL({ embed }: CopyURLProps) {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Dialog.Root>
|
||||
<Dialog.Root open={dialogOpen} onOpenChange={setDialogOpen}>
|
||||
<Dialog.Trigger>
|
||||
<Button>
|
||||
<Link2Icon />
|
||||
@@ -132,6 +131,8 @@ export function CopyURL({ embed }: CopyURLProps) {
|
||||
state: stringify(shallowState),
|
||||
});
|
||||
|
||||
setDialogOpen(false);
|
||||
|
||||
return `${location.origin}/tools/embed/${embed}/host?${searchParams.toString()}`;
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user