You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The URL detection function should use its href parameter instead of always checking data.href, ensuring it correctly identifies full URLs based on the passed argument.
Why: Using data.href instead of the function parameter in isFullUrl is a bug that will break external link detection; switching to test href fixes this core logic error.
Medium
Remove stray literal
Remove the stray numeric literal 4; in dispatchOpenEvent, which appears to be a leftover debug artifact and leads to unreachable or erroneous code paths.
Why: The stray 4; serves no purpose and can cause confusing or unreachable code paths, so removing it improves code cleanliness.
Medium
Use hash for route extraction
Extract the current route from window.location.hash rather than the full href, and remove the debug console.log. Use a regex that targets the segment after the hash for accurate matching.
-const match = URLroute.match(/([^/]+)$/);-console.log("match", match);+const hash = window.location.hash;+const match = hash.match(/#\/(?:app|s)\/[^/]+\/(.+)/);+const currentRoute = match ? match[1] : "";
Suggestion importance[1-10]: 6
__
Why: Extracting the route from window.location.hash with a more precise regex and removing the debug console.log enhances route parsing accuracy and removes noisy output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes Made
How to Test
Notes