Skip to content

Commit

Permalink
fix: Improve performance list method (#153)
Browse files Browse the repository at this point in the history
* fix: update ConversationV2 createdAt property

* remove test

* resolve comments

* Remove unused import statement

* fix lint issue

* Fix createdAt field name in Conversations data class
  • Loading branch information
Ezequiel Leanes authored Jan 18, 2024
1 parent 943314a commit 1a1e055
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data class ConversationV2(
val context: Invitation.InvitationV1.Context,
val peerAddress: String,
val client: Client,
val createdAtNs: Long? = null,
private val header: SealedInvitationHeaderV1,
) {

Expand All @@ -50,12 +51,13 @@ data class ConversationV2(
context = invitation.context,
peerAddress = peerAddress,
client = client,
createdAtNs = header.createdNs,
header = header,
)
}
}

val createdAt: Date = Date(header.createdNs / 1_000_000)
val createdAt: Date = Date((createdAtNs ?: header.createdNs) / 1_000_000)

/**
* This lists messages sent to the [Conversation].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ data class Conversations(
context = data.invitation.context,
peerAddress = data.peerAddress,
client = client,
createdAtNs = data.createdNs,
header = Invitation.SealedInvitationHeaderV1.getDefaultInstance(),
),
)
Expand Down

0 comments on commit 1a1e055

Please sign in to comment.