Skip to content

Commit 03206fc

Browse files
committed
[BOOK-161] feat: 최초 진입 시 초기 데이터 로드 구현
1 parent 9a0ca9e commit 03206fc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.ninecraft.booket.feature.library
22

33
import androidx.compose.runtime.Composable
4+
import androidx.compose.runtime.LaunchedEffect
45
import androidx.compose.runtime.getValue
56
import androidx.compose.runtime.mutableIntStateOf
67
import androidx.compose.runtime.mutableStateOf
@@ -127,6 +128,16 @@ class LibraryPresenter @AssistedInject constructor(
127128
}
128129
}
129130

131+
LaunchedEffect(Unit) {
132+
if (uiState == UiState.Idle || uiState is UiState.Error) {
133+
getLibraryBooks(
134+
status = currentFilter.getApiValue(),
135+
page = START_INDEX,
136+
size = PAGE_SIZE
137+
)
138+
}
139+
}
140+
130141
return LibraryUiState(
131142
uiState = uiState,
132143
footerState = footerState,

0 commit comments

Comments
 (0)