Skip to content

Commit 325320a

Browse files
committed
Update: scoped storage 대응
1 parent cdd8931 commit 325320a

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

data-github/src/main/kotlin/io/github/jisungbin/gitmessengerbot/data/github/repo/GithubRepoRepositoryImpl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import retrofit2.Retrofit
3030
class GithubRepoRepositoryImpl(retrofit: Retrofit) : GithubRepoRepository {
3131
private val api = retrofit.create(GithubRepoService::class.java)
3232
private val githubData: GithubData = Storage.read(GithubConstant.DataPath, null)?.toModel()
33-
?: /*throw DataGithubException("GithubConfig.DataPath 데이터가 null 이에요.")*/ GithubData() // TODO: null 대응 (ScopedStorage 대응)
33+
?: /*throw DataGithubException("GithubConfig.DataPath 데이터가 null 이에요.")*/ GithubData() // TODO: null 대응 (ScopedStorage 고려해서)
3434

3535
override suspend fun getFileContent(
3636
repoName: String,

presentation/src/main/kotlin/io/github/jisungbin/gitmessengerbot/activity/editor/js/editor.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ import io.github.jisungbin.gitmessengerbot.activity.editor.js.mvi.JsEditorMviSta
6060
import io.github.jisungbin.gitmessengerbot.activity.editor.js.mvi.MviJsEditorSuccessType
6161
import io.github.jisungbin.gitmessengerbot.common.constant.GithubConstant
6262
import io.github.jisungbin.gitmessengerbot.common.core.Storage
63-
import io.github.jisungbin.gitmessengerbot.common.exception.PresentationException
6463
import io.github.jisungbin.gitmessengerbot.common.extension.runIf
6564
import io.github.jisungbin.gitmessengerbot.common.extension.toBase64
6665
import io.github.jisungbin.gitmessengerbot.common.extension.toModel
@@ -201,7 +200,7 @@ private fun DrawerLayout(
201200

202201
val repoName = script.name
203202
val gitUser: GithubData = Storage.read(GithubConstant.DataPath, null)?.toModel()
204-
?: throw PresentationException("GithubConfig.DataPath 데이터가 null 이에요.")
203+
?: GithubData() // TODO: null 대응 (ScopedStorage 고려해서)
205204
val repoPath = "script.${script.lang.getScriptSuffix()}"
206205
val repoDescription = GithubConstant.DefaultRepoDescription // TODO
207206
val repoBranch = AppConfig.appValue.gitDefaultBranch // TODO

presentation/src/main/kotlin/io/github/jisungbin/gitmessengerbot/activity/main/dashboard/script/header.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fun Header(searchField: MutableState<TextFieldValue>) {
115115
val app by AppConfig.app.collectAsState()
116116
val backgroundService = Intent(context, BackgroundService::class.java)
117117
val githubJson =
118-
Storage.read(GithubConstant.DataPath, null) // TODO: null 처리 (ScopedStorage 대응해서)
118+
Storage.read(GithubConstant.DataPath, null) // TODO: null 처리 (ScopedStorage 고려해서)
119119
val githubData: GithubData = githubJson?.toModel() ?: GithubData(userName = "User")
120120
var searching by remember { mutableStateOf(false) }
121121

presentation/src/main/kotlin/io/github/jisungbin/gitmessengerbot/di/module/RetrofitModule.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import dagger.hilt.InstallIn
1818
import dagger.hilt.components.SingletonComponent
1919
import io.github.jisungbin.gitmessengerbot.common.constant.GithubConstant
2020
import io.github.jisungbin.gitmessengerbot.common.core.Storage
21-
import io.github.jisungbin.gitmessengerbot.common.exception.PresentationException
2221
import io.github.jisungbin.gitmessengerbot.common.extension.toModel
2322
import io.github.jisungbin.gitmessengerbot.di.qualifier.AouthRetrofit
2423
import io.github.jisungbin.gitmessengerbot.di.qualifier.SignedRetrofit
@@ -43,8 +42,8 @@ object RetrofitModule {
4342
private class AuthInterceptor : Interceptor {
4443
override fun intercept(chain: Interceptor.Chain): Response {
4544
var builder = chain.request().newBuilder()
46-
val githubData: GithubData = Storage.read(GithubConstant.DataPath, null)?.toModel()
47-
?: throw PresentationException("GithubConfig.DataPath 값이 null 이에요.")
45+
val githubData: GithubData =
46+
Storage.read(GithubConstant.DataPath, null)?.toModel() ?: GithubData() // TODO: null 대응 (ScopedStorage 고려해서)
4847
builder = builder
4948
.addHeader("Authorization", "token ${githubData.aouthToken}")
5049
.addHeader("Accept", "application/json")

0 commit comments

Comments
 (0)