Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9d5fccb5 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Rename accountUuid to accountId

parent 8668fabd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ internal fun DrawerContentPreview() {
        DrawerContent(
            state = DrawerContract.State(
                accounts = persistentListOf(),
                selectedAccountUuid = null,
                selectedAccountId = null,
                folders = persistentListOf(),
            ),
            onEvent = {},
@@ -30,7 +30,7 @@ internal fun DrawerContentWithAccountPreview() {
        DrawerContent(
            state = DrawerContract.State(
                accounts = persistentListOf(DISPLAY_ACCOUNT),
                selectedAccountUuid = DISPLAY_ACCOUNT.uuid,
                selectedAccountId = DISPLAY_ACCOUNT.uuid,
                folders = persistentListOf(),
            ),
            onEvent = {},
@@ -47,7 +47,7 @@ internal fun DrawerContentWithFoldersPreview() {
                accounts = persistentListOf(
                    DISPLAY_ACCOUNT,
                ),
                selectedAccountUuid = null,
                selectedAccountId = null,
                folders = persistentListOf(
                    UNIFIED_FOLDER,
                    DISPLAY_FOLDER,
@@ -67,7 +67,7 @@ internal fun DrawerContentWithSelectedFolderPreview() {
                accounts = persistentListOf(
                    DISPLAY_ACCOUNT,
                ),
                selectedAccountUuid = DISPLAY_ACCOUNT.uuid,
                selectedAccountId = DISPLAY_ACCOUNT.uuid,
                folders = persistentListOf(
                    UNIFIED_FOLDER,
                    DISPLAY_FOLDER,
@@ -88,7 +88,7 @@ internal fun DrawerContentWithSelectedUnifiedFolderPreview() {
                accounts = persistentListOf(
                    DISPLAY_ACCOUNT,
                ),
                selectedAccountUuid = DISPLAY_ACCOUNT.uuid,
                selectedAccountId = DISPLAY_ACCOUNT.uuid,
                folders = persistentListOf(
                    UNIFIED_FOLDER,
                    DISPLAY_FOLDER,
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ internal object FakeData {
    )

    val DISPLAY_FOLDER = DisplayAccountFolder(
        accountUuid = ACCOUNT_UUID,
        accountId = ACCOUNT_UUID,
        folder = FOLDER,
        isInTopGroup = false,
        unreadMessageCount = 14,
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ internal interface DomainContract {
        }

        fun interface GetDisplayFoldersForAccount {
            operator fun invoke(accountUuid: String, includeUnifiedFolders: Boolean): Flow<List<DisplayFolder>>
            operator fun invoke(accountId: String, includeUnifiedFolders: Boolean): Flow<List<DisplayFolder>>
        }

        /**
+4 −4
Original line number Diff line number Diff line
@@ -3,15 +3,15 @@ package app.k9mail.feature.navigation.drawer.domain.entity
import app.k9mail.core.mail.folder.api.Folder

internal data class DisplayAccountFolder(
    val accountUuid: String,
    val accountId: String,
    val folder: Folder,
    val isInTopGroup: Boolean,
    override val unreadMessageCount: Int,
    override val starredMessageCount: Int,
) : DisplayFolder {
    override val id: String = createDisplayAccountFolderId(accountUuid, folder.id)
    override val id: String = createDisplayAccountFolderId(accountId, folder.id)
}

fun createDisplayAccountFolderId(accountUuid: String, folderId: Long): String {
    return "${accountUuid}_$folderId"
fun createDisplayAccountFolderId(accountId: String, folderId: Long): String {
    return "${accountId}_$folderId"
}
+3 −3
Original line number Diff line number Diff line
@@ -17,11 +17,11 @@ internal class GetDisplayFoldersForAccount(
    private val repository: DisplayFolderRepository,
    private val messageCountsProvider: MessageCountsProvider,
) : UseCase.GetDisplayFoldersForAccount {
    override fun invoke(accountUuid: String, includeUnifiedFolders: Boolean): Flow<List<DisplayFolder>> {
        return repository.getDisplayFoldersFlow(accountUuid).map { displayFolders ->
    override fun invoke(accountId: String, includeUnifiedFolders: Boolean): Flow<List<DisplayFolder>> {
        return repository.getDisplayFoldersFlow(accountId).map { displayFolders ->
            displayFolders.map { displayFolder ->
                DisplayAccountFolder(
                    accountUuid = accountUuid,
                    accountId = accountId,
                    folder = displayFolder.folder,
                    isInTopGroup = displayFolder.isInTopGroup,
                    unreadMessageCount = displayFolder.unreadMessageCount,
Loading