diff --git a/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/base/BaseActivity.kt b/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/base/BaseActivity.kt index 86d98a76..494191df 100644 --- a/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/base/BaseActivity.kt +++ b/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/base/BaseActivity.kt @@ -1,28 +1,15 @@ package boostcamp.and07.mindsync.ui.base -import android.content.Intent import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.repeatOnLifecycle -import boostcamp.and07.mindsync.data.repository.login.LogoutEvent -import boostcamp.and07.mindsync.data.repository.login.LogoutEventRepository -import boostcamp.and07.mindsync.ui.login.LoginActivity -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch -import javax.inject.Inject abstract class BaseActivity(private val layoutResId: Int) : AppCompatActivity() { private var _binding: T? = null val binding get() = _binding!! - @Inject - lateinit var logoutRepository: LogoutEventRepository - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) _binding = DataBindingUtil.setContentView(this, layoutResId) @@ -32,29 +19,9 @@ abstract class BaseActivity(private val layoutResId: Int) : abstract fun init() - open fun setLogoutObserve() { - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.STARTED) { - logoutRepository.logoutEvent.collectLatest { event -> - when (event) { - is LogoutEvent.Logout -> { - navigateToLoginScreen() - } - } - } - } - } - } - override fun onDestroy() { super.onDestroy() _binding = null } - private fun navigateToLoginScreen() { - val intent = Intent(this, LoginActivity::class.java) - intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK - startActivity(intent) - finish() - } }