JohnyP36 / YT-Nonstop

Extension to let YouTube run nonstop with autoplay, autoconfirm and automatic pressing the loopbutton.
GNU General Public License v2.0
14 stars 1 forks source link

Make DRY principle for `lastInteractionTime = new Date().getTime();` #7

Closed JohnyP36 closed 2 years ago

JohnyP36 commented 2 years ago

Any additions, changes or removals is at the Authors discretion.
You're free to counterargue (to a certain point) if you disagree with the decision.
To avoid being banned, don't constantly re-open or create new (related) issue reports or pull requests.

Prerequisites

  • [x] I've read the Code of Conduct and the Contributing Guidelines
  • [x] This is more than one or two issue(s)
  • Otherwise open a new issue
  • [x] I performed a cursory search of the issue tracker to avoid opening a duplicate issue
  • Your issue may already be reported.
  • [ ] I tried to reproduce the issue when...
  • [ ] Other webextensions related to Youtube are disabled
  • [ ] using a new, unmodified browser profile
  • [x] I am running the latest version of the extension

Describe the issue

Screenshot(s)

Browser & Extension version

| Browser name & version | Extension Version | | :--- | :---: | | \`e.g. **MS Edge** 94\` | \`e.g. _**1.6.4**_\`| #### Notes
JohnyP36 commented 2 years ago

@webdevium Do I also have to change the lastInteractionTime into updateLastInteractionTime ? (see below)

function isIdle() {
  let currTime = new Date().getTime();
  debug(
    `\ntime passed: ${
      currTime - lastInteractionTime
    }\nisPausedByUser: ${isPausedByUser}\nisHoldingMouseDown: ${isHoldingMouseDown}`
  );
  if (
    currTime - lastInteractionTime <= idleTimeout ||

https://github.com/JohnyP36/YT-Nonstop/pull/7/files

vanodevium commented 2 years ago

@JohnyP36

Variable's name is lastInteractionTime Function which updates variable, is updateLastInteractionTime