fix(member-info): 구서버 멤버정보 누락 필드 하위 호환을 보장한다
This commit is contained in:
@@ -13,6 +13,7 @@ import kr.co.vividnext.sodalive.audio_content.PlaybackTrackingData
|
||||
import kr.co.vividnext.sodalive.audio_content.PlaybackTrackingRepository
|
||||
import kr.co.vividnext.sodalive.base.BaseViewModel
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.settings.ContentType
|
||||
import kr.co.vividnext.sodalive.settings.event.EventItem
|
||||
import kr.co.vividnext.sodalive.settings.event.EventRepository
|
||||
import kr.co.vividnext.sodalive.settings.notification.UpdateNotificationSettingRequest
|
||||
@@ -103,9 +104,19 @@ class MainViewModel(
|
||||
SharedPreferenceManager.point = data.point
|
||||
SharedPreferenceManager.role = data.role.name
|
||||
SharedPreferenceManager.isAuth = data.isAuth
|
||||
SharedPreferenceManager.countryCode = data.countryCode.ifBlank { "KR" }
|
||||
SharedPreferenceManager.isAdultContentVisible = data.isAdultContentVisible
|
||||
SharedPreferenceManager.contentPreference = data.contentType.ordinal
|
||||
|
||||
val localCountryCode = SharedPreferenceManager.countryCode.ifBlank { "KR" }
|
||||
val resolvedCountryCode = data.countryCode?.ifBlank { "KR" } ?: localCountryCode
|
||||
val resolvedIsAdultContentVisible =
|
||||
data.isAdultContentVisible ?: SharedPreferenceManager.isAdultContentVisible
|
||||
val resolvedContentType =
|
||||
data.contentType
|
||||
?: ContentType.entries.getOrNull(SharedPreferenceManager.contentPreference)
|
||||
?: ContentType.ALL
|
||||
|
||||
SharedPreferenceManager.countryCode = resolvedCountryCode
|
||||
SharedPreferenceManager.isAdultContentVisible = resolvedIsAdultContentVisible
|
||||
SharedPreferenceManager.contentPreference = resolvedContentType.ordinal
|
||||
SharedPreferenceManager.isAuditionNotification =
|
||||
data.auditionNotice ?: false
|
||||
if (
|
||||
|
||||
@@ -21,11 +21,11 @@ data class GetMemberInfoResponse(
|
||||
@SerializedName("auditionNotice")
|
||||
val auditionNotice: Boolean?,
|
||||
@SerializedName("countryCode")
|
||||
val countryCode: String,
|
||||
val countryCode: String? = null,
|
||||
@SerializedName("isAdultContentVisible")
|
||||
val isAdultContentVisible: Boolean,
|
||||
val isAdultContentVisible: Boolean? = null,
|
||||
@SerializedName("contentType")
|
||||
val contentType: ContentType
|
||||
val contentType: ContentType? = null
|
||||
)
|
||||
|
||||
enum class MemberRole {
|
||||
|
||||
Reference in New Issue
Block a user