Twitching Lurkist

Automatically lurk on Twitch channels you follow

< Commentaires sur Twitching Lurkist

Question / commentaire

§
Posté le: 2024-06-07

Hope this helps - script wasn't running on my machine before these changes (source editor was showing eslint errors) - script ran after changes YMMV

Code block below (with line numbers)

//Running Tampermonkey version 5.1.1
//on Chromium Version 125.0.6422.113 (Official Build) (64-bit)

//corrected eslint no multispaces eroor - deleted space closest to btn.innertext

//original
265  btn.innerText  = 'X';

//new
265  btn.innerText = 'X';

//corrected eslint no-return-assign errors - enclosed return assignments in parens

//original
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => prefs.autoClose = x);
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

//new
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => (prefs.autoClose = x));
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

//original
384   const bufferTgl = createToggle('lowLatDisable', 'Disable low latency mode', prefs.lowLatDisable, x => prefs.lowLatDisable = x);
385   const pauseTgl = createToggle('detectPause', 'Pause streams detection', prefs.detectPause, x => prefs.detectPause = x);

//new
384   const bufferTgl = createToggle('lowLatDisable', 'Disable low latency mode', prefs.lowLatDisable, x => (prefs.lowLatDisable = x));
385   const pauseTgl = createToggle('detectPause', 'Pause streams detection', prefs.detectPause, x => (prefs.detectPause = x));
XspeedAuteur
§
Posté le: 2024-06-09
//new
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => (prefs.autoClose = x));
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

What about this line 382 then? Doesn't look changed

§
Posté le: 2024-06-09

my bad, forgot to do the parens thing on line 382

382 const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => (prefs.autoCinema = x));

XspeedAuteur
§
Posté le: 2024-06-09

Yeah, but this tells me that was not the reason the script was not working for you.

Parentheses are not required as per newer ES202X standards. Even more so with extraneous whitespace, some people use that to make multiple lines of assignments more readable.

§
Posté le: 2024-06-09

Thanks for the feedback, it helped a lot.
Have a good weekend!

Poster une réponse

Connectez-vous pour poster une réponse.