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

release snutt 3.7.5 #357

Closed
wants to merge 14 commits into from
Closed
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-keep public enum com.wafflestudio.snutt2.** { *; }
-keep class com.wafflestudio.snutt2.lib.** { *; }
-keep class com.wafflestudio.snutt2.model.** { *; }
-keep class com.wafflestudio.snutt2.core.network.** { *; }

# https://github.com/square/retrofit/issues/3751#issuecomment-1192043644
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
Expand Down
31 changes: 14 additions & 17 deletions app/src/main/java/com/wafflestudio/snutt2/RemoteConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package com.wafflestudio.snutt2

import com.wafflestudio.snutt2.core.network.NetworkConnectivityManager
import com.wafflestudio.snutt2.core.network.SNUTTNetworkDataSource
import com.wafflestudio.snutt2.data.user.UserRepository
import com.wafflestudio.snutt2.lib.network.dto.core.RemoteConfigDto
import com.wafflestudio.snutt2.lib.network.dto.core.toExternalModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.map
Expand All @@ -22,29 +20,28 @@ import javax.inject.Singleton
@Singleton
class RemoteConfig @Inject constructor(
api: SNUTTNetworkDataSource,
userRepository: UserRepository,
networkConnectivityManager: NetworkConnectivityManager,
) {
private val config = MutableStateFlow(RemoteConfigDto())

init {
CoroutineScope(Dispatchers.Main).launch {
combine(
userRepository.accessToken.filter { it.isNotEmpty() },
networkConnectivityManager.networkConnectivity.filter { it },
) { _, _ ->
withContext(Dispatchers.IO) {
runCatching {
api._getRemoteConfig()
}.onSuccess {
config.emit(it.toExternalModel())
}.onFailure {
// NOTE: 서버 장애나 네트워크 오프라인 등의 이유로 config를 받아오지 못한 경우 지도를 숨긴다.
// https://wafflestudio.slack.com/archives/C0PAVPS5T/p1706504661308259?thread_ts=1706451688.745159&cid=C0PAVPS5T
config.emit(RemoteConfigDto(disableMapFeature = true))
networkConnectivityManager.networkConnectivity
.filter { it }
.map {
withContext(Dispatchers.IO) {
runCatching {
api._getRemoteConfig()
}.onSuccess {
config.emit(it.toExternalModel())
}.onFailure {
// NOTE: 서버 장애나 네트워크 오프라인 등의 이유로 config를 받아오지 못한 경우 지도를 숨긴다.
// https://wafflestudio.slack.com/archives/C0PAVPS5T/p1706504661308259?thread_ts=1706451688.745159&cid=C0PAVPS5T
config.emit(RemoteConfigDto(disableMapFeature = true))
}
}
}
}.collect()
.collect()
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {

extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = 33
defaultConfig.targetSdk = 34
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
snuttVersionName=3.7.3
snuttVersionName=3.7.5
Loading