Skip to content
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

(Bug report) Two help pages will be opened when the help button is clicked. #570

Closed
SiriusXT opened this issue Nov 9, 2024 · 3 comments
Closed
Labels
bug Something isn't working effort-low

Comments

@SiriusXT
Copy link
Contributor

SiriusXT commented Nov 9, 2024

TriliumNext Version

0.90.10

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

windows

Description

Since two clicks are listened to, two help pages will open when the help button is clicked.
图片

  1. src\public\app\widgets\shared_switch.js : this.$helpButton.on('click', e => utils.openHelp($(e.target)));
  2. src\public\app\services\utils.js: initHelpButtons
    I'm not sure that removing which listen is the better solution.

Additionally, the missing import caused the help for template_switch to open only one page: the file src/public/app/widgets/template_switch.js is missing the import statement import utils from "../services/utils.js";, which results in the template_switch help opening only a single help page.

Error logs

No response

@meichthys meichthys added bug Something isn't working effort-low labels Nov 9, 2024
@meichthys
Copy link
Contributor

I can't seem to reproduce this on 0.90.11 on Windows 11.
Just a single page opens for me.

@SiriusXT
Copy link
Contributor Author

SiriusXT commented Nov 14, 2024

I can still consistently reproduce this issue on the latest develop branch using Firefox on Windows. You need to click the question mark next to 'share.'
图片

Clicking the question mark next to 'template' only opens one page due to another bug.

Interestingly, only one help page opens in Edge, but window.open(url, '_blank'); in Notes\src\public\app\services\utils.js is indeed called twice. This might be due to a security mechanism in Edge that only allows one page to open within a short time frame.

I've identified the cause of the issue: one instance is listening to the question mark button, and the other is listening to $(window).
I feel that listening on $(window) might affect performance, as each click requires bubbling, but it's more convenient since it doesn’t require setting a listener for each question mark button. So, it’s a tough choice.

@eliandoran
Copy link
Contributor

Thank you for the detailed report, @SiriusXT !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort-low
Projects
None yet
Development

No branches or pull requests

3 participants