Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX/#160] 알림 수정 #169

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main
if (!viewModel.getAskedNotification()) {
requestNotificationPermission()
viewModel.setAskedkNotification(true)
viewModel.setOnNotification(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package com.teumteum.teumteum.presentation.signin
import androidx.lifecycle.ViewModel
import com.teumteum.domain.entity.SocialLoginResult
import com.teumteum.domain.repository.AuthRepository
import com.teumteum.domain.repository.SettingRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import javax.inject.Inject

@HiltViewModel
class SignInViewModel @Inject constructor(
private val repository: AuthRepository
private val repository: AuthRepository,
private val settingRepository: SettingRepository
): ViewModel() {

private val _memberState = MutableStateFlow<SignInUiState>(SignInUiState.Init)
Expand Down Expand Up @@ -47,6 +49,10 @@ class SignInViewModel @Inject constructor(
fun setAskedkNotification(didAsk: Boolean) {
repository.setAskedNotification(didAsk)
}

fun setOnNotification(isOn: Boolean) {
settingRepository.setNotification(isOn)
}
}

sealed interface SignInUiState {
Expand Down
Loading