Skip to content

Commit 166e352

Browse files
committed
Remove listeners based on form statusg
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent 3d17d04 commit 166e352

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

public/pages/workflow_detail/workflow_detail.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,15 @@ export function WorkflowDetail(props: WorkflowDetailProps) {
132132
// ones that will go to the home page, or different plugins within
133133
// the side navigation.
134134
const links = document.querySelectorAll(`a[href*="app/"]`);
135-
links.forEach((link) => {
136-
link.addEventListener('click', handleLinkClick);
137-
});
135+
if (blockNavigation) {
136+
links.forEach((link) => {
137+
link.addEventListener('click', handleLinkClick);
138+
});
139+
} else {
140+
links.forEach((link) => {
141+
link.removeEventListener('click', handleLinkClick);
142+
});
143+
}
138144
return () => {
139145
links.forEach((link) => {
140146
link.removeEventListener('click', handleLinkClick);

0 commit comments

Comments
 (0)