Skip to content

Commit 40cdcfb

Browse files
author
Jeff Yanta
committed
Merge branch 'develop'
2 parents ae4d6ac + 7987835 commit 40cdcfb

7 files changed

Lines changed: 26 additions & 8 deletions

File tree

api/src/androidTest/java/com/getcode/util/UUIDTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class UUIDTests {
1212
val memo = uuid.blockchainMemo
1313

1414
assertEquals(
15-
"AQAAAAAAwko78q1PR1aUToGUj/EIgg==",
15+
"Gk2Yb7W6BypLsdRoJqMAqXHDoV2jT",
1616
memo
1717
)
1818
}

api/src/main/java/com/getcode/model/intents/IntentPrivateTransfer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class IntentPrivateTransfer(
3939
.setSendPrivatePayment(
4040
TransactionService.SendPrivatePaymentMetadata.newBuilder().apply {
4141
setDestination(this@IntentPrivateTransfer.destination.bytes.toSolanaAccount())
42-
setIsWithdrawal(isWithdrawal)
42+
setIsWithdrawal(this@IntentPrivateTransfer.isWithdrawal)
4343
setExchangeData(
4444
TransactionService.ExchangeData.newBuilder()
4545
.setQuarks(grossAmount.kin.quarks)

api/src/main/java/com/getcode/network/client/Client_Transaction.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,16 @@ fun Client.transferWithResult(
116116
isWithdrawal: Boolean,
117117
tippedUsername: String? = null,
118118
): Result<Unit> {
119-
return transferWithResultSingle(amount, fee, additionalFees, organizer, rendezvousKey, destination, isWithdrawal, tippedUsername)
120-
.blockingGet()
119+
return transferWithResultSingle(
120+
amount = amount,
121+
fee = fee,
122+
additionalFees = additionalFees,
123+
organizer = organizer,
124+
rendezvousKey = rendezvousKey,
125+
destination = destination,
126+
isWithdrawal = isWithdrawal,
127+
tippedUsername = tippedUsername
128+
).blockingGet()
121129
}
122130

123131

api/src/main/java/com/getcode/utils/UUID.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.getcode.utils
22

3-
import android.util.Base64
3+
import com.getcode.vendor.Base58
44
import org.kin.sdk.base.tools.intToByteArray
55
import java.nio.ByteBuffer
66
import java.util.UUID
@@ -29,7 +29,7 @@ val UUID.blockchainMemo: String
2929

3030
data.addAll(this.bytes.toList())
3131

32-
return Base64.encodeToString(data.toByteArray(), Base64.NO_WRAP)
32+
return Base58.encode(data.toByteArray())
3333
}
3434

3535
val List<Byte>.toUuid: UUID

app/src/main/java/com/getcode/notifications/CodePushMessagingService.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.getcode.manager.AuthManager
1313
import com.getcode.manager.SessionManager
1414
import com.getcode.model.notifications.NotificationType
1515
import com.getcode.model.notifications.parse
16+
import com.getcode.network.BalanceController
1617
import com.getcode.network.HistoryController
1718
import com.getcode.network.TipController
1819
import com.getcode.network.repository.PushRepository
@@ -52,6 +53,9 @@ class CodePushMessagingService : FirebaseMessagingService(),
5253
@Inject
5354
lateinit var authManager: AuthManager
5455

56+
@Inject
57+
lateinit var balanceController: BalanceController
58+
5559
@Inject
5660
lateinit var historyController: HistoryController
5761

@@ -86,6 +90,7 @@ class CodePushMessagingService : FirebaseMessagingService(),
8690

8791
if (type == NotificationType.ChatMessage) {
8892
launch { historyController.fetchChats() }
93+
launch { balanceController.fetchBalanceSuspend() }
8994
launch { tipController.checkForConnection() }
9095
}
9196
} else {

app/src/main/java/com/getcode/view/main/home/HomeViewModel.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class HomeViewModel @Inject constructor(
221221
}.launchIn(viewModelScope)
222222

223223
tipController.showTwitterSplat
224-
.onEach { show ->
224+
.onEach { show ->
225225
uiFlow.update {
226226
it.copy(showTwitterSplat = show)
227227
}
@@ -498,6 +498,7 @@ class HomeViewModel @Inject constructor(
498498
}
499499

500500
historyController.fetchChats()
501+
balanceController.fetchBalanceSuspend()
501502

502503
if (shown) {
503504
delay(300)
@@ -1197,7 +1198,9 @@ class HomeViewModel @Inject constructor(
11971198
client.fetchLimits(isForce = true),
11981199
)
11991200
}
1200-
.subscribe({ viewModelScope.launch { historyController.fetchChats() } }, {
1201+
.subscribe({
1202+
viewModelScope.launch { historyController.fetchChats() }
1203+
}, {
12011204
scannedRendezvous.remove(payload.rendezvous.publicKey)
12021205
ErrorUtils.handleError(it)
12031206
})

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838

3939
<string name="subtitle_youReceivedTip">Someone tipped you $1$s</string>
4040
<string name="subtitle_youSentTip">You tipped someone $1$s</string>
41+
42+
<string name="title_chat_tips">Tips</string>
4143
</resources>

0 commit comments

Comments
 (0)