Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aayush262 2024-03-18 10:39:42 +05:30
commit 22dccaa24b
40 changed files with 561 additions and 165 deletions

View file

@ -68,8 +68,11 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
binding.profileViewPager.isUserInputEnabled = false
lifecycleScope.launch(Dispatchers.IO) {
val userid = intent.getIntExtra("userId", 0)
val respond = Anilist.query.getUserProfile(userid)
val userid = intent.getIntExtra("userId", -1)
val username = intent.getStringExtra("username") ?: ""
val respond =
if (userid != -1) Anilist.query.getUserProfile(userid) else
Anilist.query.getUserProfile(username)
val user = respond?.data?.user
if (user == null) {
toast("User not found")