Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const DashboardEmbedControls = ({ dashboardId, onHide }: Props) => {
const [loading, setLoading] = useState(false); // whether we are currently doing an async thing
const [embedded, setEmbedded] = useState<EmbeddedDashboard | null>(null); // the embedded dashboard config
const [allowedDomains, setAllowedDomains] = useState<string>('');
const [modal, contextHolder] = Modal.useModal();

const endpoint = `/api/v1/dashboard/${dashboardId}/embedded`;
// whether saveable changes have been made to the config
Expand Down Expand Up @@ -100,7 +101,7 @@ export const DashboardEmbedControls = ({ dashboardId, onHide }: Props) => {
}, [endpoint, allowedDomains]);

const disableEmbedded = useCallback(() => {
Modal.confirm({
modal.confirm({
title: t('Disable embedding?'),
content: t('This will remove your current embed configuration.'),
okType: 'danger',
Expand Down Expand Up @@ -128,7 +129,7 @@ export const DashboardEmbedControls = ({ dashboardId, onHide }: Props) => {
});
},
});
}, [endpoint]);
}, [endpoint, modal]);

useEffect(() => {
setReady(false);
Expand Down Expand Up @@ -167,6 +168,7 @@ export const DashboardEmbedControls = ({ dashboardId, onHide }: Props) => {

return (
<>
{contextHolder}
{embedded ? (
DocsConfigDetails ? (
<DocsConfigDetails embeddedId={embedded.uuid} />
Expand Down
Loading