Loading feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ internal fun DrawerContentWithAccountPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(DISPLAY_ACCOUNT), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf(), ), onEvent = {}, Loading Loading @@ -67,7 +67,7 @@ internal fun DrawerContentWithSelectedFolderPreview() { accounts = persistentListOf( DISPLAY_ACCOUNT, ), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf( UNIFIED_FOLDER, DISPLAY_FOLDER, Loading @@ -88,7 +88,7 @@ internal fun DrawerContentWithSelectedUnifiedFolderPreview() { accounts = persistentListOf( DISPLAY_ACCOUNT, ), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf( UNIFIED_FOLDER, DISPLAY_FOLDER, Loading feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/FakeData.kt +6 −1 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import app.k9mail.core.mail.folder.api.Folder import app.k9mail.core.mail.folder.api.FolderType import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount Loading Loading @@ -35,7 +37,10 @@ internal object FakeData { } val DISPLAY_ACCOUNT = DisplayAccount( account = ACCOUNT, id = ACCOUNT_UUID, name = DISPLAY_NAME, email = EMAIL_ADDRESS, color = Color.Red.toArgb(), unreadMessageCount = 0, starredMessageCount = 0, ) Loading feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/entity/DisplayAccount.kt +5 −6 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.entity import app.k9mail.legacy.account.Account internal data class DisplayAccount( val account: Account, val id: String, val name: String, val email: String, val color: Int, val unreadMessageCount: Int, val starredMessageCount: Int, ) { val uuid: String = account.uuid } ) feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/usecase/GetDisplayAccounts.kt +4 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,10 @@ internal class GetDisplayAccounts( combine(messageCountsFlows) { messageCountsList -> messageCountsList.mapIndexed { index, messageCounts -> DisplayAccount( account = accounts[index], id = accounts[index].uuid, name = accounts[index].displayName, email = accounts[index].email, color = accounts[index].chipColor, unreadMessageCount = messageCounts.unread, starredMessageCount = messageCounts.starred, ) Loading feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContent.kt +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ internal fun DrawerContent( .fillMaxHeight() .testTag("DrawerContent"), ) { val selectedAccount = state.accounts.firstOrNull { it.uuid == state.selectedAccountId } val selectedAccount = state.accounts.firstOrNull { it.id == state.selectedAccountId } Column { selectedAccount?.let { AccountView( Loading Loading
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ internal fun DrawerContentWithAccountPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(DISPLAY_ACCOUNT), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf(), ), onEvent = {}, Loading Loading @@ -67,7 +67,7 @@ internal fun DrawerContentWithSelectedFolderPreview() { accounts = persistentListOf( DISPLAY_ACCOUNT, ), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf( UNIFIED_FOLDER, DISPLAY_FOLDER, Loading @@ -88,7 +88,7 @@ internal fun DrawerContentWithSelectedUnifiedFolderPreview() { accounts = persistentListOf( DISPLAY_ACCOUNT, ), selectedAccountId = DISPLAY_ACCOUNT.uuid, selectedAccountId = DISPLAY_ACCOUNT.id, folders = persistentListOf( UNIFIED_FOLDER, DISPLAY_FOLDER, Loading
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/FakeData.kt +6 −1 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import app.k9mail.core.mail.folder.api.Folder import app.k9mail.core.mail.folder.api.FolderType import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount Loading Loading @@ -35,7 +37,10 @@ internal object FakeData { } val DISPLAY_ACCOUNT = DisplayAccount( account = ACCOUNT, id = ACCOUNT_UUID, name = DISPLAY_NAME, email = EMAIL_ADDRESS, color = Color.Red.toArgb(), unreadMessageCount = 0, starredMessageCount = 0, ) Loading
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/entity/DisplayAccount.kt +5 −6 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.entity import app.k9mail.legacy.account.Account internal data class DisplayAccount( val account: Account, val id: String, val name: String, val email: String, val color: Int, val unreadMessageCount: Int, val starredMessageCount: Int, ) { val uuid: String = account.uuid } )
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/usecase/GetDisplayAccounts.kt +4 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,10 @@ internal class GetDisplayAccounts( combine(messageCountsFlows) { messageCountsList -> messageCountsList.mapIndexed { index, messageCounts -> DisplayAccount( account = accounts[index], id = accounts[index].uuid, name = accounts[index].displayName, email = accounts[index].email, color = accounts[index].chipColor, unreadMessageCount = messageCounts.unread, starredMessageCount = messageCounts.starred, ) Loading
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContent.kt +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ internal fun DrawerContent( .fillMaxHeight() .testTag("DrawerContent"), ) { val selectedAccount = state.accounts.firstOrNull { it.uuid == state.selectedAccountId } val selectedAccount = state.accounts.firstOrNull { it.id == state.selectedAccountId } Column { selectedAccount?.let { AccountView( Loading