changed "justinfanXXX" to "anonymous"

This commit is contained in:
fourtf 2018-05-25 18:23:13 +02:00
parent e5be1d1286
commit 90551acf37

View file

@ -31,11 +31,17 @@ Window::Window(WindowType _type)
{ {
auto app = getApp(); auto app = getApp();
app->accounts->Twitch.currentUsername.connect([this](const std::string &newUsername, auto) { app->accounts->Twitch.currentUserChanged.connect([this] {
if (newUsername.empty()) { auto user = getApp()->accounts->Twitch.getCurrent();
if (user->isAnon()) {
this->refreshWindowTitle("Not logged in"); this->refreshWindowTitle("Not logged in");
this->userLabel->getLabel().setText("anonymous");
} else { } else {
this->refreshWindowTitle(QString::fromStdString(newUsername)); this->refreshWindowTitle(user->getUserName());
this->userLabel->getLabel().setText(user->getUserName());
} }
}); });
@ -48,10 +54,6 @@ Window::Window(WindowType _type)
app->windows->showAccountSelectPopup( app->windows->showAccountSelectPopup(
this->userLabel->mapToGlobal(this->userLabel->rect().bottomLeft())); // this->userLabel->mapToGlobal(this->userLabel->rect().bottomLeft())); //
}); });
app->accounts->Twitch.currentUserChanged.connect([=] {
this->userLabel->getLabel().setText(app->accounts->Twitch.getCurrent()->getUserName());
});
} }
if (_type == Window::Main) { if (_type == Window::Main) {