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

Show game time in lobby #7407

Merged
merged 3 commits into from
Jun 28, 2024
Merged

Show game time in lobby #7407

merged 3 commits into from
Jun 28, 2024

Conversation

Wikignometry
Copy link
Contributor

This PR addresses issue #6994 around showing the game time in lobby. The idea is that it would help users figure out if a game is worth watching or not.

As shown in the screenshot below, the expected behavior is that it:

  • displays the number of minutes a game has taken in the bottom right corner of the game row
  • does not display a number if the game has not started

Screenshot:
image

@NoahTheDuke
Copy link
Collaborator

This is cool! Could you make it hover the start timestamp? Some people (myself included) prefer to view the raw time.

@NoahTheDuke NoahTheDuke merged commit dc9b849 into mtgred:master Jun 28, 2024
3 checks passed
@NBKelly
Copy link
Collaborator

NBKelly commented Jul 1, 2024

I'm finding this is actually causing me errors (black screen in the lobby whenever there is an active game).

I can force this to work if I make create-new-lobby in lobby.clj to create a new instant for the date (it's fallback behavior). Otherwise I think this will work for some people (if their browser doesn't support whatever date function we use? I'm not sure what the conditions are to not send a :date through ws), and will cause black screens if a :date key is passed through the ws connection.

With a tiny bit of deconstruction, I'm seeing that the :date we get from game is some sort of native code not compatible with the instant type.

check

so:

  • type of inst/now as called in the lobby: correct
  • date object that my browser is spitting at me (as a string): Mon Jul 01 2024 19:18:02 GMT+1200 (New Zealand Standard Time)
  • type of that object: function Date() { [native code] }

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.

4 participants