Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,4 @@ data class FollowingList(
@SerializedName("aliasName") val aliasName: String,
@SerializedName("aliasColor") val aliasColor: String,
@SerializedName("isFollowing") val isFollowing: Boolean
)

@Serializable
data class MyRecentFollowingsResponse(
@SerializedName("myFollowingUsers") val myFollowingUsers: List<RecentWriterList>
)

@Serializable
data class RecentWriterList(
@SerializedName("userId") val userId: Long,
@SerializedName("nickname") val nickname: String,
@SerializedName("profileImageUrl") val profileImageUrl: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ class FeedViewModel @Inject constructor(
private val feedRepository: FeedRepository,
private val userRepository: UserRepository
) : ViewModel() {

private val _uiState = MutableStateFlow(FeedUiState())
val uiState = _uiState.asStateFlow()

fun fetchRecentWriters() {
private var allFeedsNextCursor: String? = null
private var myFeedsNextCursor: String? = null
private var isLoadingAllFeeds = false
private var isLoadingMyFeeds = false

private fun updateState(update: (FeedUiState) -> FeedUiState) {
_uiState.value = update(_uiState.value)
}

init {
loadAllFeeds()
fetchRecentWriters()
}


private fun updateState(update: (FeedUiState) -> FeedUiState) {
_uiState.value = update(_uiState.value)
}

fun onTabSelected(index: Int) {
updateState { it.copy(selectedTabIndex = index) }

Expand Down Expand Up @@ -183,6 +183,7 @@ class FeedViewModel @Inject constructor(
0 -> refreshAllFeeds()
1 -> refreshMyFeeds()
}
updateState { it.copy(isRefreshing = false) }
}
}

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,6 @@
<string name="error_book_detail_load_failed">책 정보를 불러오는데 실패했습니다.</string>
<string name="error_book_save_failed">책 저장에 실패했습니다.</string>

<!-- General error messages -->
<string name="error_unknown">알 수 없는 오류가 발생했습니다.</string>

<!-- FeedWriteViewModel -->
<string name="error_feed_id_not_returned">서버 feedId 반환 오류</string>

Expand Down