summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-05-14 11:01:07 -0300
committerTorsten Grote <t@grobox.de>2020-05-15 14:26:42 -0300
commit171a1ae228b801d5c0d54c6c7e7ad8aa458d6bce (patch)
tree765016dc7b6bc9d3c10fe69ec50f52b9e94b3366 /wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt
parentbedd7b05eb0b5ee69cd5f35b283e713cf8af29dc (diff)
downloadtaler-android-171a1ae228b801d5c0d54c6c7e7ad8aa458d6bce.tar.gz
taler-android-171a1ae228b801d5c0d54c6c7e7ad8aa458d6bce.tar.bz2
taler-android-171a1ae228b801d5c0d54c6c7e7ad8aa458d6bce.zip
[wallet] clean up old history code that not needed anymore
The history is now only for debugging visible in dev mode, so it is sufficient to show JSON and not parse all its fields.
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt11
1 files changed, 4 insertions, 7 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt b/wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt
index 72967b2..9052d6e 100644
--- a/wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/history/DevHistoryManager.kt
@@ -26,10 +26,11 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import net.taler.wallet.backend.WalletBackendApi
import org.json.JSONObject
+import java.util.*
sealed class HistoryResult {
object Error : HistoryResult()
- class Success(val history: History) : HistoryResult()
+ class Success(val history: List<HistoryEvent>) : HistoryResult()
}
class DevHistoryManager(
@@ -59,7 +60,7 @@ class DevHistoryManager(
mHistory.postValue(HistoryResult.Error)
return
}
- val history = History()
+ val history = LinkedList<HistoryEvent>()
val json = result.getJSONArray("history")
for (i in 0 until json.length()) {
val event: HistoryEvent = mapper.readValue(json.getString(i))
@@ -68,11 +69,7 @@ class DevHistoryManager(
}
history.reverse() // show latest first
mProgress.postValue(false)
- mHistory.postValue(
- HistoryResult.Success(
- history
- )
- )
+ mHistory.postValue(HistoryResult.Success(history))
}
}