-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Code] fix query string key conflict #36620
[Code] fix query string key conflict #36620
Conversation
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
@@ -57,7 +57,7 @@ export class EditorComponent extends React.Component<IProps> { | |||
|
|||
public componentDidMount(): void { | |||
this.container = document.getElementById('mainEditor') as HTMLElement; | |||
this.monaco = new MonacoHelper(this.container, this.props); | |||
this.monaco = new MonacoHelper(this.container, this.props, this.props.location.search); |
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.
What if the location.search
changed after the editor is created?
@@ -18,7 +19,7 @@ export function registerReferencesAction(e: editor.IStandaloneCodeEditor) { | |||
const position = ed.getPosition(); | |||
const { uri } = parseSchema(ed.getModel().uri.toString()); | |||
const refUrl = `git:/${uri}!L${position.lineNumber - 1}:${position.column - 1}`; | |||
const queries = queryString.parse(location.search); | |||
const queries = url.parse(search, true).query; |
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.
Is there a way to get the search
from current url instead of passing by a parameter?
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.
window.location.search
is empty if query string is after the hash.
💚 Build Succeeded |
Summary
fix query string key conflict
history.search
would be empty if placed after a hash