Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Single post in Quality of Life changes [UserScript]

Forum Index > PokéFarm > Guides > Quality of Life changes [UserScript] >

Niet [Adam]'s Avatarhypermode-12.pngNiet [Adam]
Niet [Adam]'s Avatar
admin1.pngbooster.pnghypermode.pngcomplete.pngd+.png
I come to you with a bug report! Your script uncovered a bug on the server, which I have patched, but it shouldn't be happening in the first place! https://pokefarm.com/forum/thread/320255/Error-while-party-clicking/post/6152449 The offending code seems to be this: /* * Sometimes clicks happen to fast for Pokefarm to add the 'working' class * so, instead of waiting for that class to exist, add the qolpartyclickhide * class here if Hide All mode is enabled */ obj.jQuery(document).on('click','#partybox>div.party>div', (e) => { if (obj.settings.hideAll === true) { // sometimes the target is the div, sometimes it's the div.action const target$ = obj.jQuery(e.target); let divPkmn$; let divAction$; if(target$.hasClass('action')) { divPkmn$ = target$.parent().children('div.pkmn'); divAction$ = target$; } else if(target$.attr('data-berry') !== undefined) { divPkmn$ = target$.parent().parent().parent().children('div.pkmn'); divAction$ = target$.parent().parent().parent().children('div.action'); } else { divPkmn$ = target$.children('div.pkmn'); divAction$ = target$.children('div.action'); } divPkmn$.children().remove(); divAction$.addClass('qolpartyclickhide').removeClass('working'); } }); I think .removeClass('working') is incorrect, because this allows (attempted) duplicate interactions to be sent.
Clip from Pokémon anime, re-lined by me
-- OMNOMNOM!
Featured story: Injustice Feedback welcome!
© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page