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

fix UI deadlocks + improve visual word colors #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cortze
Copy link
Collaborator

@cortze cortze commented May 8, 2022

Fixed problem with the terminal manager (tview) that was freezing the entire UI.

Added a flag that restricts printing debug messages in the console until the UI is initialized.

NOTE: We can play alone even if we don't have any peers connected, we should take a look at it (the user can achieve a longer word count by playing in localhost and then connecting to the network)

@cortze cortze requested review from ajnavarro and Wondertan May 8, 2022 23:30
Comment on lines +114 to +118
go func() {
// mark as initialized after ~200 milliseconds
time.Sleep(200 * time.Millisecond)
*initialized = true
}()
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, basing initialization on a timer is not a good idea in my opinion. You should have someplace in your code where you are sure everything is initialized.

Comment on lines +37 to +40
// wait untill UI is initialilzed
for !ui.uiInitialized {
time.Sleep(200 * time.Millisecond)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of doing this, you can call SetLog when you know you can do it (UI is initialized) from the parent class.

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