@@ -66,7 +66,6 @@ import io.github.jisungbin.gitmessengerbot.activity.imageviewer.ImageViewActivit
66
66
import io.github.jisungbin.gitmessengerbot.common.constant.GithubConstant
67
67
import io.github.jisungbin.gitmessengerbot.common.constant.IntentConstant
68
68
import io.github.jisungbin.gitmessengerbot.common.core.Storage
69
- import io.github.jisungbin.gitmessengerbot.common.exception.PresentationException
70
69
import io.github.jisungbin.gitmessengerbot.common.extension.toModel
71
70
import io.github.jisungbin.gitmessengerbot.domain.github.model.user.GithubData
72
71
import io.github.jisungbin.gitmessengerbot.theme.colors
@@ -115,9 +114,9 @@ fun Header(searchField: MutableState<TextFieldValue>) {
115
114
116
115
val app by AppConfig .app.collectAsState()
117
116
val backgroundService = Intent (context, BackgroundService ::class .java)
118
- val githubJson = Storage .read( GithubConstant . DataPath , null )
119
- ? : throw PresentationException ( " GithubConfig.DataPath의 값이 null 이에요. " )
120
- val githubData: GithubData = githubJson.toModel()
117
+ val githubJson =
118
+ Storage .read( GithubConstant . DataPath , null ) // TODO: null 처리 (ScopedStorage 대응해서 )
119
+ val githubData: GithubData = githubJson? .toModel() ? : GithubData (userName = " User " )
121
120
var searching by remember { mutableStateOf(false ) }
122
121
123
122
ConstraintLayout (
@@ -208,6 +207,7 @@ fun Header(searchField: MutableState<TextFieldValue>) {
208
207
style = TextStyle (fontFamily = defaultFontFamily, fontSize = 15 .sp)
209
208
)
210
209
Switch (
210
+ modifier = Modifier .height(20 .dp),
211
211
checked = app.power,
212
212
colors = SwitchDefaults .colors(
213
213
checkedThumbColor = Color .White ,
@@ -240,7 +240,10 @@ fun Header(searchField: MutableState<TextFieldValue>) {
240
240
text = Bot .getAllScripts().size.toString(),
241
241
style = TextStyle (fontFamily = defaultFontFamily, fontSize = 25 .sp)
242
242
)
243
- Text (text = " 개" , style = TextStyle (fontFamily = defaultFontFamily, fontSize = 15 .sp))
243
+ Text (
244
+ text = " 개" ,
245
+ style = TextStyle (fontFamily = defaultFontFamily, fontSize = 15 .sp)
246
+ )
244
247
}
245
248
}
246
249
MenuBox (
@@ -255,7 +258,10 @@ fun Header(searchField: MutableState<TextFieldValue>) {
255
258
text = Bot .getRunnableScripts().size.toString(),
256
259
style = TextStyle (fontFamily = defaultFontFamily, fontSize = 25 .sp)
257
260
)
258
- Text (text = " 개" , style = TextStyle (fontFamily = defaultFontFamily, fontSize = 15 .sp))
261
+ Text (
262
+ text = " 개" ,
263
+ style = TextStyle (fontFamily = defaultFontFamily, fontSize = 15 .sp)
264
+ )
259
265
}
260
266
}
261
267
MenuBox (
0 commit comments