Skip to content

[bugfix] Clicking 'Code Now' will open multiple files #216

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

Merged
merged 1 commit into from
Mar 17, 2019
Merged

Conversation

jdneo
Copy link
Member

@jdneo jdneo commented Mar 17, 2019

Fix #217

Bug repro step:

  1. Click 2-3 problem node to preview the description one by one
  2. Click Code Now
  3. It will generate all the files for the problems that have been previewed before

Root cause:
The listeners are registered every time executing preview (). They should be registered only once when this.panel has not been created.

@jdneo jdneo added this to the 0.13.1 milestone Mar 17, 2019
@jdneo jdneo requested a review from Vigilans March 17, 2019 12:37
@Vigilans
Copy link
Contributor

I tested the bug on my side:
Click problem [3], [70], [169], and the behavior appears as expected. Besides, after testing the behavior multiple times, one of the problem may fail to be shown for JSON parse error on input. After this PR, this problem may disappear.

Other flaws of the preview command:

  • the extension will still fetch problem description after clicking the active problem node
  • did not make use of local cache

Copy link
Contributor

@Vigilans Vigilans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview's code now works properly on my side now.

@jdneo jdneo merged commit 0fb736c into master Mar 17, 2019
@jdneo jdneo deleted the cs/bugfi branch March 17, 2019 13:07
@jdneo
Copy link
Member Author

jdneo commented Mar 17, 2019

Merged for now. We can improve both the preview and the result webview in 0.13.2 using the markdown solution, which I think can improve the experience significantly. Meanwhile, more bugs and some refactoring work can be addressed in 0.13.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants