Skip to content

Conversation

@TheMadSword
Copy link
Contributor

I don't really see how to solve it without scala (as the tag suggested), without adding very specific selector (in the findAndRender function), so I modified scala to add a css class to make it lighter to read. Tell me if you see another cleaner way of doing it :3 .

@TheMadSword TheMadSword force-pushed the fix_tempban_negative_time branch from f3e5aec to 1685adf Compare July 6, 2023 06:04
h1(trans.sorry()),
p(trans.weHadToTimeYouOutForAWhile()),
p(trans.timeoutExpires(strong(secondsFromNow(ban.remainingSeconds)))),
p(trans.timeoutExpires(strong(secondsFromNow(ban.remainingSeconds, "reload")))),
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to change secondsFromNow.

You can do secondsFromNow(ban.remainingSeconds)(cls := "extra css classes")

@ornicar
Copy link
Collaborator

ornicar commented Jul 6, 2023

The code supposed to automatically reload already exists (and is much simpler): https://github.com/lichess-org/lila/blob/master/ui/lobby/src/ctrl.ts#L101-L103

The question is, why doesn't it work?

@TheMadSword
Copy link
Contributor Author

The code supposed to automatically reload already exists (and is much simpler): https://github.com/lichess-org/lila/blob/master/ui/lobby/src/ctrl.ts#L101-L103

The question is, why doesn't it work?

Mmm I'll give a look later. Good point.

@TheMadSword TheMadSword force-pushed the fix_tempban_negative_time branch 3 times, most recently from ee794e1 to 9207e42 Compare July 7, 2023 04:24
@TheMadSword TheMadSword force-pushed the fix_tempban_negative_time branch from 9207e42 to aba747d Compare July 7, 2023 04:24
@TheMadSword
Copy link
Contributor Author

TheMadSword commented Jul 7, 2023

The code supposed to automatically reload already exists (and is much simpler): https://github.com/lichess-org/lila/blob/master/ui/lobby/src/ctrl.ts#L101-L103

The question is, why doesn't it work?

Hi again,

The source was a misspelling that happened with commit fd4655c in 2018. PR is fixed.

I noticed that locally, once the page is requested, if it takes for instance 15 seconds to load, then the timer will "expire" THEN 15 seconds later the page will reload. I doubt such a behavior would happen in prod (due to fast load); but I'll keep an eye and try to be banned once to test.

@ornicar
Copy link
Collaborator

ornicar commented Jul 7, 2023

good find, thank you.

And here's the culprit

playban: any;

@ornicar ornicar merged commit 67f2f31 into lichess-org:master Jul 7, 2023
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