diff --git a/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepository.kt b/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepository.kt index a926bcf5f..b094896f2 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepository.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepository.kt @@ -19,8 +19,6 @@ interface UserRepository { val firstBookmarkAlert: StateFlow - val rnConfig: StateFlow - // login with local id suspend fun postSignIn(id: String, password: String) @@ -95,8 +93,4 @@ interface UserRepository { suspend fun setCompactMode(compact: Boolean) suspend fun setFirstBookmarkAlertShown() - - suspend fun setRNConfig(state: Boolean) - - suspend fun rnUrl(): String } diff --git a/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepositoryImpl.kt b/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepositoryImpl.kt index fa31bfaba..abb17520e 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepositoryImpl.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/data/user/UserRepositoryImpl.kt @@ -40,9 +40,6 @@ class UserRepositoryImpl @Inject constructor( override val firstBookmarkAlert = storage.firstBookmarkAlert.asStateFlow() - override val rnConfig: StateFlow - get() = storage.rnTempConfig.asStateFlow() - override suspend fun postSignIn(id: String, password: String) { val response = api._postSignIn(PostSignInParams(id, password)) storage.prefKeyUserId.update(response.userId.toOptional()) @@ -271,14 +268,6 @@ class UserRepositoryImpl @Inject constructor( storage.firstBookmarkAlert.update(false) } - override suspend fun setRNConfig(state: Boolean) { - storage.rnTempConfig.update(state) - } - - override suspend fun rnUrl(): String { - return api._getRemoteConfig().friends?.src?.get("android") ?: "" - } - private suspend fun getFirebaseToken(): String { return suspendCoroutine { cont -> FirebaseMessaging.getInstance().token.addOnCompleteListener( diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/RNModuleActivity.kt b/app/src/main/java/com/wafflestudio/snutt2/views/RNModuleActivity.kt index c8a6480d5..32fc46048 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/RNModuleActivity.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/RNModuleActivity.kt @@ -35,10 +35,13 @@ class RNModuleActivity : ReactActivity() { .build() rootView = ReactRootView(this@RNModuleActivity) - rootView?.startReactApplication(reactInstanceManager, "friends", Bundle().apply { - putString("x-access-token", rnViewModel.token) - putString("x-access-apikey", applicationContext.getString(R.string.api_key)) - }) + rootView?.startReactApplication( + reactInstanceManager, "friends", + Bundle().apply { + putString("x-access-token", rnViewModel.token) + putString("x-access-apikey", applicationContext.getString(R.string.api_key)) + } + ) setContentView(rootView) } } diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/RNViewModel.kt b/app/src/main/java/com/wafflestudio/snutt2/views/RNViewModel.kt index 99169e7cb..bcbf02c9c 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/RNViewModel.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/RNViewModel.kt @@ -31,11 +31,7 @@ class RNViewModel @Inject constructor( try { val bundleFile = File(application.applicationContext.cacheDir, "android.jsbundle") - val url = if (userRepository.rnConfig.value) { - "http://localhost:8081/index.bundle?platform=android" - } else { - userRepository.rnUrl() - } + val url = "http://localhost:8081/index.bundle?platform=android" val urlConnection = URL(url).openConnection() as HttpURLConnection urlConnection.connect() val inputStream = urlConnection.inputStream diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/UserViewModel.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/UserViewModel.kt index 3f18636b0..db3ca0216 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/UserViewModel.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/UserViewModel.kt @@ -30,8 +30,6 @@ class UserViewModel @Inject constructor( val firstBookmarkAlert: StateFlow = userRepository.firstBookmarkAlert - val rnConfig = userRepository.rnConfig - suspend fun fetchUserInfo() { userRepository.fetchUserInfo() } @@ -162,8 +160,4 @@ class UserViewModel @Inject constructor( suspend fun setFirstBookmarkAlertShown() { userRepository.setFirstBookmarkAlertShown() } - - suspend fun toggleRNConfig() { - userRepository.setRNConfig(rnConfig.value.not()) - } } diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/TimetablePage.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/TimetablePage.kt index 820815a29..3ddfc0de6 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/TimetablePage.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/TimetablePage.kt @@ -3,17 +3,16 @@ package com.wafflestudio.snutt2.views.logged_in.home.timetable import android.app.Activity import android.content.Intent import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.material.Text -import androidx.compose.ui.Alignment import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue @@ -39,8 +38,9 @@ import com.wafflestudio.snutt2.components.compose.ComposableStatesWithScope import com.wafflestudio.snutt2.components.compose.DrawerIcon import com.wafflestudio.snutt2.components.compose.IconWithAlertDot import com.wafflestudio.snutt2.components.compose.LectureListIcon -import com.wafflestudio.snutt2.components.compose.RNIcon +import com.wafflestudio.snutt2.components.compose.RingingAlarmIcon import com.wafflestudio.snutt2.components.compose.ShareIcon +import com.wafflestudio.snutt2.components.compose.TipCloseIcon import com.wafflestudio.snutt2.components.compose.TopBar import com.wafflestudio.snutt2.components.compose.TrashIcon import com.wafflestudio.snutt2.components.compose.clicks @@ -51,16 +51,15 @@ import com.wafflestudio.snutt2.ui.SNUTTColors import com.wafflestudio.snutt2.ui.SNUTTTypography import com.wafflestudio.snutt2.views.LocalDrawerState import com.wafflestudio.snutt2.views.LocalNavController +import com.wafflestudio.snutt2.views.LocalRemoteConfig import com.wafflestudio.snutt2.views.LocalTableState import com.wafflestudio.snutt2.views.NavigationDestination import com.wafflestudio.snutt2.views.RNModuleActivity import com.wafflestudio.snutt2.views.logged_in.home.TableListViewModel -import com.wafflestudio.snutt2.views.logged_in.home.settings.PoorSwitch import com.wafflestudio.snutt2.views.logged_in.home.settings.UserViewModel import com.wafflestudio.snutt2.views.logged_in.home.showTitleChangeDialog import com.wafflestudio.snutt2.views.logged_in.vacancy_noti.VacancyViewModel import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import java.io.File @Composable @@ -140,7 +139,7 @@ fun TimetablePage() { } }, ) - RNIcon( + LectureListIcon( modifier = Modifier .size(30.dp) .clicks {