From e50cfa808b8c68a1fb813b428d8c103eabdccdd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Mon, 16 Dec 2024 20:15:57 -0300 Subject: [PATCH] At least it doesn't crash --- .../com/example/dcav2gui/InstanceInterface.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java index 007e215..3242dd2 100644 --- a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java +++ b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java @@ -447,10 +447,18 @@ public class InstanceInterface { String dealOrderHistory = value.has("deal_order_history") && value.get("deal_order_history").isJsonPrimitive() ? value.get("deal_order_history").getAsString() : null; String pauseReason = value.has("pause_reason") && value.get("pause_reason").isJsonPrimitive() ? value.get("pause_reason").getAsString() : null; String statusString = value.has("status_string") && value.get("status_string").isJsonPrimitive() ? value.get("status_string").getAsString() : null; - JsonObject oldLong = null; + JsonObject oldLong; + OldLongDictionary oldLongDictionary = null; if (value.has("old_long")) { oldLong = value.get("old_long").getAsJsonObject(); //translate from json to OldLongDictionary + oldLongDictionary = new OldLongDictionary( + oldLong.get("datetime").getAsString(), + oldLong.get("fees_paid_in_quote").getAsDouble(), + oldLong.get("quote_spent").getAsDouble(), + oldLong.get("tp_amount").getAsDouble(), + oldLong.get("tp_price").getAsDouble() + ); } valueToReturn.add(new WorkerStatsData( @@ -482,7 +490,7 @@ public class InstanceInterface { safetyPriceTable, dealOrderHistory, pauseReason, - oldLong, + oldLongDictionary, statusString )); } catch (Exception e) { @@ -621,6 +629,7 @@ public class InstanceInterface { workerStatsData.getPrice(), workerStatsData.getTakeProfitPrice(), workerStatsData.getIsShort(), + //Let's deal with this later false, false, false,