Skip to content

Commit

Permalink
[fix]#201: 첫 화면에서 프로필 설정 안내 삭제해요
Browse files Browse the repository at this point in the history
  • Loading branch information
flash159483 committed Nov 25, 2024
1 parent 9788d28 commit 0e78540
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ object DataStoreKey {
const val REFRESH_TOKEN_EXPIRED_AT = "refresh_token_expired_date"
const val SIGN_UP_TOKEN = "signup_token"
const val PUSH_TOKEN = "push_token"
const val SETTING_DIALOG = "setting_dialog"
const val VOTE_ONBOARDING = "vote_onboarding"
const val IS_NOTIFICATION_SET_UP = "is_notification_set_up"
const val NAME = "name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import com.bff.wespot.designsystem.component.banner.WSBanner
import com.bff.wespot.designsystem.component.banner.WSBannerType
import com.bff.wespot.designsystem.component.button.WSButton
import com.bff.wespot.designsystem.component.indicator.WSHomeTabRow
import com.bff.wespot.designsystem.component.modal.WSDialog
import com.bff.wespot.designsystem.theme.Gray100
import com.bff.wespot.designsystem.theme.Gray600
import com.bff.wespot.designsystem.theme.StaticTypeScale
Expand All @@ -65,7 +64,6 @@ import com.bff.wespot.vote.ui.VoteCard
import com.bff.wespot.vote.viewmodel.VoteHomeViewModel
import com.ramcosta.composedestinations.annotation.Destination
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.delay
import org.orbitmvi.orbit.compose.collectAsState
import java.time.LocalDate

Expand Down Expand Up @@ -121,23 +119,6 @@ internal fun VoteHomeScreen(
}
}

if (state.showSettingDialog) {
WSDialog(
title = stringResource(R.string.show_profile_setting),
subTitle = stringResource(R.string.write_introduction),
okButtonText = stringResource(R.string.sure),
cancelButtonText = stringResource(R.string.next_time),
okButtonClick = {
voteNavigator.navigateToCharacterScreen()
action(VoteAction.ChangeSettingDialog(false))
},
cancelButtonClick = {
action(VoteAction.ChangeSettingDialog(false))
},
onDismissRequest = {},
)
}

OnLifecycleEvent { owner, event ->
when (event) {
Lifecycle.Event.ON_RESUME -> {
Expand All @@ -151,14 +132,6 @@ internal fun VoteHomeScreen(
else -> {}
}
}

LaunchedEffect(Unit) {
delay(EDIT_POPUP_TIME)
action(VoteAction.GetSettingDialogOption)
if (state.kakaoContent == KakaoContent.EMPTY) {
action(VoteAction.GetKakaoContent)
}
}
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ sealed class VoteAction {
data object EndDate : VoteAction()
data class GetFirst(val date: String) : VoteAction()
data class OnTabChanged(val index: Int) : VoteAction()
data object GetSettingDialogOption : VoteAction()
data class ChangeSettingDialog(val showDialog: Boolean) : VoteAction()
data object GetKakaoContent : VoteAction()
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ data class VoteUiState(
val voteResults: List<VoteResult> = emptyList(),
val isLoading: Boolean = false,
val selectedTabIndex: Int = 0,
val showSettingDialog: Boolean = false,
val playStoreLink: String,
val kakaoContent: KakaoContent = KakaoContent.EMPTY,
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import androidx.lifecycle.viewModelScope
import com.bff.wespot.common.extension.onNetworkFailure
import com.bff.wespot.common.util.toDateTimeString
import com.bff.wespot.domain.repository.CommonRepository
import com.bff.wespot.domain.repository.DataStoreRepository
import com.bff.wespot.domain.repository.firebase.config.RemoteConfigRepository
import com.bff.wespot.domain.repository.vote.VoteRepository
import com.bff.wespot.domain.util.DataStoreKey
import com.bff.wespot.domain.util.RemoteConfigKey
import com.bff.wespot.model.common.KakaoSharingType
import com.bff.wespot.ui.base.BaseViewModel
Expand Down Expand Up @@ -36,7 +34,6 @@ import javax.inject.Inject
@HiltViewModel
class VoteHomeViewModel @Inject constructor(
private val voteRepository: VoteRepository,
private val dataStoreRepository: DataStoreRepository,
private val remoteConfigRepository: RemoteConfigRepository,
private val commonRepository: CommonRepository,
) : BaseViewModel(), ContainerHost<VoteUiState, VoteSideEffect> {
Expand Down Expand Up @@ -69,8 +66,6 @@ class VoteHomeViewModel @Inject constructor(
is VoteAction.EndDate -> stopUpdatingDate()
is VoteAction.GetFirst -> getFirstVoteResults(action.date)
is VoteAction.OnTabChanged -> onTabChanged(action.index)
is VoteAction.GetSettingDialogOption -> getSetting()
is VoteAction.ChangeSettingDialog -> changeSettingDialog(action.showDialog)
VoteAction.GetKakaoContent -> getKakaoContent()
}
}
Expand Down Expand Up @@ -111,21 +106,6 @@ class VoteHomeViewModel @Inject constructor(
reduce { state.copy(selectedTabIndex = index) }
}

private fun getSetting() = intent {
viewModelScope.launch(coroutineDispatcher) {
dataStoreRepository.getBoolean(DataStoreKey.SETTING_DIALOG).collect {
if (!it) {
reduce { state.copy(showSettingDialog = !it) }
}
}
}
}

private fun changeSettingDialog(showDialog: Boolean) = intent {
reduce { state.copy(showSettingDialog = showDialog) }
dataStoreRepository.saveBoolean(DataStoreKey.SETTING_DIALOG, true)
}

private fun getKakaoContent() = intent {
viewModelScope.launch(coroutineDispatcher) {
commonRepository.getKakaoContent(KakaoSharingType.TELL.name)
Expand Down
4 changes: 0 additions & 4 deletions feature/vote/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
<string name="not_your_classmate">우리 반 친구가 아닌가요?</string>
<string name="wrong_report">우리 반 친구를 잘못 신고한 것이 확인될 경우 서비스 이용에 제한이 생실 수 았어요</string>
<string name="it_is_not">네 아니에요</string>
<string name="show_profile_setting">프로필 설정을 해볼까요?</string>
<string name="write_introduction">친구들이 알아볼 수 있도록\n캐릭터 선택과 한 줄 소개 작성을 완료해 주세요</string>
<string name="sure">네 좋아요</string>
<string name="next_time">다음에 할래요</string>
<string name="quite_setting">프로필 설정을 중단하시나요?</string>
<string name="auto_select">선택하셨던 캐릭터와 배경색은 저장되지 않으며\n기본 캐릭터와 배경색으로 자동 설정됩니다</string>
<string name="yes_stop">네 중단할래요</string>
Expand Down

0 comments on commit 0e78540

Please sign in to comment.