Skip to content

Commit

Permalink
fixed updating list after authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed Apr 14, 2024
1 parent 9b142db commit 7b55161
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nlightreader/widgets/NlightTemplates/Shikimori.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from data.ui.widgets.shikimori import Ui_Form
from nlightreader.consts.enums import Nl
from nlightreader.dialogs import TokenAuthMessageBox, UserDataAuthMessageBox
from nlightreader.items import Manga
from nlightreader.items import Manga, User
from nlightreader.parsers import ShikimoriLib
from nlightreader.utils import translate, Worker
from nlightreader.widgets.NlightTemplates.BaseWidget import MangaItemBasedWidget
Expand Down Expand Up @@ -47,9 +47,10 @@ def get_user_info(self):
self.ui.auth_btn.setEnabled(False)
return self.catalog.get_user()

def set_user_info(self, whoami):
if whoami.nickname:
self.ui.auth_btn.setText(whoami.nickname)
def set_user_info(self, user: User):
if user.nickname:
self.ui.auth_btn.setText(user.nickname)
self.get_content()
else:
self.ui.auth_btn.setText(translate("Other", "Sign in"))
self.ui.auth_btn.setEnabled(True)
Expand Down

0 comments on commit 7b55161

Please sign in to comment.