Skip to content
Open
Show file tree
Hide file tree
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 @@ -26,6 +26,8 @@ const CreateDiagramDialog = () => {
useEffect(() => {
const handleMessage = async (e: MessageEvent) => {
const action = e.data.action;
const type = e.data.type;

if (action === 'save') {
const data = e.data.data;
const metadata = new URLSearchParams({
Expand Down Expand Up @@ -54,6 +56,8 @@ const CreateDiagramDialog = () => {
console.error('Error preparing diagram insertion', error);
showAlertDialog('Error preparing diagram, please try again');
}
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
handleDialogClose();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const EditDiagramDialog = () => {
useEffect(() => {
const handleMessage = async (e: MessageEvent) => {
const action = e.data.action;
const type = e.data.type;

console.log('action', action);
if (action === 'save') {
const data = e.data.data;
Expand Down Expand Up @@ -73,6 +75,8 @@ const EditDiagramDialog = () => {
console.error('Error preparing diagram update', error);
showAlertDialog('Error preparing diagram update, please try again');
}
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
handleDialogClose();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SelectDiagramDialog = () => {
return;
}
const url = buildUrl(
'/app/plugins/select?pluginSource=googledocs',
'/app/plugins/confluence/select?pluginSource=googledocs',
authState.token
);
setDiagramsUrl(url);
Expand All @@ -35,6 +35,8 @@ const SelectDiagramDialog = () => {
useEffect(() => {
const handleMessage = async (e: MessageEvent) => {
const action = e.data.action;
const type = e.data.type;

if (action === 'save') {
const data = e.data.data;
const metadata = new URLSearchParams({
Expand Down Expand Up @@ -63,6 +65,9 @@ const SelectDiagramDialog = () => {
showAlertDialog('Error preparing diagram, please try again');
console.error('Error preparing diagram insertion', error);
}
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
// Handle back navigation from the iframe - close the dialog
handleDialogClose();
}
};

Expand Down
Loading