Skip to content

Commit 7f6b7b3

Browse files
committed
fix: pass walletIndex to VssBackupClient setup
1 parent 0b3be33 commit 7f6b7b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/java/to/bitkit/data/backup/VssBackupClient.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ class VssBackupClient @Inject constructor(
2626
) {
2727
private val isSetup = CompletableDeferred<Unit>()
2828

29-
suspend fun setup() = withContext(bgDispatcher) {
29+
suspend fun setup(walletIndex: Int = 0) = withContext(bgDispatcher) {
3030
try {
3131
withTimeout(30.seconds) {
3232
Logger.debug("VSS client setting up…", context = TAG)
3333
val vssUrl = Env.vssServerUrl
3434
val lnurlAuthServerUrl = Env.lnurlAuthServerUrl
35+
val vssStoreId = vssStoreIdProvider.getVssStoreId(walletIndex)
3536
Logger.verbose("Building VSS client with vssUrl: '$vssUrl'")
3637
Logger.verbose("Building VSS client with lnurlAuthServerUrl: '$lnurlAuthServerUrl'")
3738
if (lnurlAuthServerUrl.isNotEmpty()) {
@@ -41,15 +42,15 @@ class VssBackupClient @Inject constructor(
4142

4243
vssNewClientWithLnurlAuth(
4344
baseUrl = vssUrl,
44-
storeId = vssStoreIdProvider.getVssStoreId(),
45+
storeId = vssStoreId,
4546
mnemonic = mnemonic,
4647
passphrase = passphrase,
4748
lnurlAuthServerUrl = lnurlAuthServerUrl,
4849
)
4950
} else {
5051
vssNewClient(
5152
baseUrl = vssUrl,
52-
storeId = vssStoreIdProvider.getVssStoreId(),
53+
storeId = vssStoreId,
5354
)
5455
}
5556
isSetup.complete(Unit)

0 commit comments

Comments
 (0)