Skip to content

Commit

Permalink
Adopted code after changes on the develop branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
TruszczynskiA committed Jun 24, 2024
1 parent 45197f7 commit 7101886
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ final class ChatMessagesBridgeService {
try $0.reduce(into: [Date: [ChatMessageData]]()) { result, chatMessage in

let timestamp = try Date(timeIntervalSince1970: TimeInterval(chatMessage.timestamp))
guard let day = timestamp.dateOnly, let messageID = try chatMessage.identifier.string else { return }
guard let day = timestamp.dateOnly else { return }

let messageData = try ChatMessageData(
identifier: .chatMessage(id: messageID),
identifier: .chatMessage(id: chatMessage.identifier.string),
timestamp: timestamp,
address: chatMessage.address,
message: chatMessage.body.string ?? "",
message: chatMessage.body.string,
metadata: chatMessage.allMetadataDictionary,
isIncomming: chatMessage.isIncomming,
isLastInContext: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ final class ChatMessageMetadata {
}

var type: MetadataType? {
get throws {
guard let string = try key.string else { return nil }
return MetadataType(rawValue: string)
}
get throws { try MetadataType(rawValue: key.string) }
}

var data: ByteVector {
Expand Down
4 changes: 4 additions & 0 deletions MobileWallet/Libraries/TariLib/Core/FFI/ByteVector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ extension ByteVector {
var data: Data {
get throws { Data(try bytes) }
}

var string: String {
get throws { try data.string }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class ChatRequestTokensView: BaseNavigationContentView {
}

var isContinueButtonEnabled: Bool = false {
didSet { continueButton.variation = isContinueButtonEnabled ? .normal : .disabled }
didSet { continueButton.isEnabled = isContinueButtonEnabled }
}

var onKeyTap: ((AmountKeyboardView.Key) -> Void)? {
Expand Down

0 comments on commit 7101886

Please sign in to comment.