Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Sep 13, 2024
1 parent 94e4a8e commit cb0f6c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ abstract class MessageDao : BaseDao<MessageEntity> {
abstract suspend fun getMessagesForGmailThread(
account: String,
folder: String,
threadId: String
threadId: Long
): List<MessageEntity>

@Query("DELETE FROM messages WHERE account = :account AND folder = :folder AND thread_id = :threadId AND is_visible = 0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ThreadDetailsViewModel(
val cachedEntities = roomDatabase.msgDao().getMessagesForGmailThread(
activeAccount.email,
GmailApiHelper.LABEL_INBOX,//fix me
threadMessageEntity.threadIdAsHEX,
threadMessageEntity.threadId ?: 0,
)

val finalList = messageEntities.map { fromServerMessageEntity ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.view.ViewGroup
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModel
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavDirections
import androidx.navigation.fragment.navArgs
import androidx.recyclerview.widget.LinearLayoutManager
import com.flowcrypt.email.R
Expand All @@ -24,7 +25,6 @@ import com.flowcrypt.email.extensions.androidx.fragment.app.launchAndRepeatWithV
import com.flowcrypt.email.extensions.androidx.fragment.app.navController
import com.flowcrypt.email.extensions.androidx.fragment.app.supportActionBar
import com.flowcrypt.email.extensions.androidx.fragment.app.toast
import com.flowcrypt.email.extensions.androidx.navigation.navigateSafe
import com.flowcrypt.email.jetpack.lifecycle.CustomAndroidViewModelFactory
import com.flowcrypt.email.jetpack.viewmodel.ThreadDetailsViewModel
import com.flowcrypt.email.ui.activity.fragment.base.BaseFragment
Expand Down Expand Up @@ -82,16 +82,18 @@ class ThreadDetailsFragment : BaseFragment<FragmentNewMessageDetailsBinding>(),
messageEntity.folder,
messageEntity.uid
)?.id?.let {
navController?.navigateSafe(
currentDestinationId = R.id.threadDetailsFragment,
directions = MessagesListFragmentDirections
.actionMessagesListFragmentToViewPagerThreadDetailsFragment(
navController?.navigate(
object : NavDirections {
override val actionId = R.id.viewPagerMessageDetailsFragment
override val arguments = ViewPagerMessageDetailsFragmentArgs(
messageEntityId = it,
localFolder = LocalFolder(
messageEntity.account,
GmailApiHelper.LABEL_INBOX
)//fix me
)
),//fix me,
sortedEntityIdListForThread = getSortedEntityIdListForThread()
).toBundle()
}
)
}
}
Expand Down
3 changes: 3 additions & 0 deletions FlowCrypt/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@
<argument
android:name="messageEntityId"
app:argType="long" />
<action
android:id="@+id/action_threadDetailsFragment_to_viewPagerMessageDetailsFragment"
app:destination="@id/viewPagerMessageDetailsFragment" />
</fragment>

<fragment
Expand Down

0 comments on commit cb0f6c3

Please sign in to comment.