Skip to content

Commit 8906707

Browse files
committed
refactor: remove redundant encryptAndUpload
1 parent cd1a3b6 commit 8906707

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

app/src/main/java/to/bitkit/repositories/BackupRepo.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package to.bitkit.repositories
22

33
import android.content.Context
4-
import com.synonym.vssclient.VssItem
54
import dagger.hilt.android.qualifiers.ApplicationContext
65
import kotlinx.coroutines.CoroutineDispatcher
76
import kotlinx.coroutines.CoroutineScope
@@ -218,7 +217,7 @@ class BackupRepo @Inject constructor(
218217
it.copy(running = true, required = System.currentTimeMillis())
219218
}
220219

221-
encryptAndUpload(category)
220+
vssBackupClient.putObject(key = category.name, data = getBackupDataBytes(category))
222221
.onSuccess {
223222
cacheStore.updateBackupStatus(category) {
224223
it.copy(
@@ -236,15 +235,6 @@ class BackupRepo @Inject constructor(
236235
}
237236
}
238237

239-
private suspend fun encryptAndUpload(category: BackupCategory): Result<VssItem> = runCatching {
240-
val dataBytes = getBackupDataBytes(category)
241-
242-
// TODO encrypt data before upload
243-
val encrypted = dataBytes
244-
245-
return vssBackupClient.putObject(category.name, encrypted)
246-
}
247-
248238
private suspend fun getBackupDataBytes(category: BackupCategory): ByteArray = when (category) {
249239
BackupCategory.SETTINGS -> {
250240
val data = settingsStore.data.first().resetPin()

app/src/main/java/to/bitkit/services/LightningService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class LightningService @Inject constructor(
113113

114114
ServiceQueue.LDK.background {
115115
node = try {
116-
if (Env.lnurlAuthSeverUrl.isNotBlank()) {
116+
if (Env.lnurlAuthSeverUrl.isNotEmpty()) {
117117
builder.buildWithVssStore(
118118
vssUrl = Env.vssServerUrl,
119119
storeId = vssStoreId,

0 commit comments

Comments
 (0)