-
Notifications
You must be signed in to change notification settings - Fork 4
Changes from alive #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,12 +45,20 @@ class EmbeddedGateway extends React.Component { | |||||||||||||||||||||||||||||||||||
| container = div | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| if (component) { | ||||||||||||||||||||||||||||||||||||
| if (component != null && getComponent(component) === null) { | ||||||||||||||||||||||||||||||||||||
| element.innerHTML = "<h1>Data Viz Error </h1><h4>Component<i> " + component + "</i> not found</h4><br>" | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| element.innerHTML = "<h1>Data Viz Error </h1><h4>Component<i> " + component + "</i> not found</h4><br>" | |
| // Safely create error message elements | |
| // Remove all children | |
| while (element.firstChild) { | |
| element.removeChild(element.firstChild); | |
| } | |
| const h1 = document.createElement("h1"); | |
| h1.textContent = "Data Viz Error"; | |
| element.appendChild(h1); | |
| const h4 = document.createElement("h4"); | |
| h4.textContent = "Component "; | |
| const i = document.createElement("i"); | |
| i.textContent = component; | |
| h4.appendChild(i); | |
| h4.appendChild(document.createTextNode(" not found")); | |
| element.appendChild(h4); | |
| element.appendChild(document.createElement("br")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,10 @@ const localReplaceLink = (url, locale) => { | |||||
| if (!pathname.startsWith("/wp/")) { | ||||||
| return url; // Not a WordPress path, leave unchanged | ||||||
| } | ||||||
| //ensuring access to media library files | ||||||
| if (pathname.startsWith("/wp/wp-content")){ | ||||||
| return url | ||||||
|
||||||
| return url | |
| return url; |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debugger statement should be removed before merging to production. This will cause the browser to pause execution in development tools, which is not intended for production code.
| debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition checks both
component != nullandgetComponent(component) === null, but this callsgetComponenttwice (once here and again on line 50). Consider storing the result in a variable to avoid redundant calls.