From 3d405bc34cc9be6829ca132701af326210e195e5 Mon Sep 17 00:00:00 2001 From: Julius Snipes Date: Fri, 29 Sep 2023 18:47:37 -0400 Subject: [PATCH] Fix big bug --- .../main/java/com/pennapps/labs/pennmobile/HomeFragment.kt | 5 +++-- .../main/java/com/pennapps/labs/pennmobile/MainActivity.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/HomeFragment.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/HomeFragment.kt index 7c7c859b..74030f7d 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/HomeFragment.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/HomeFragment.kt @@ -79,7 +79,9 @@ class HomeFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - getHomePage() + OAuth2NetworkManager(mActivity).getAccessToken { + getHomePage() + } } @RequiresApi(Build.VERSION_CODES.M) private fun getHomePage() { @@ -89,7 +91,6 @@ class HomeFragment : Fragment() { val sessionID = sp.getString(getString(R.string.huntsmanGSR_SessionID), "") val accountID = sp.getString(getString(R.string.accountID), "") val deviceID = OAuth2NetworkManager(mActivity).getDeviceId() - OAuth2NetworkManager(mActivity).getAccessToken() val bearerToken = "Bearer " + sp.getString(getString(R.string.access_token), "").toString() Log.i("HomeFragment", bearerToken) diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/MainActivity.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/MainActivity.kt index 40062fcd..98110959 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/MainActivity.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/MainActivity.kt @@ -96,7 +96,7 @@ class MainActivity : AppCompatActivity() { if (pennKey == null && !guestMode) { startLoginFragment() } else { - OAuth2NetworkManager(this).getAccessTokenStartup() + startHomeFragment() } }