Commit ca3c8796 authored by T Dev. D's avatar T Dev. D 😎
Browse files

use boolean for xpubpostxreg metadata

parent 179af9bb
......@@ -2313,9 +2313,8 @@ public class APIFactory {
info("APIFactory", "XPUB:" + args.toString());
args.append("&at=");
args.append(getAccessToken());
if(!PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTXREG, "").equals("ok")) {
if(PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTXREG, false) == false) {
args.append("&importPostmixLikeTypeChange=1");
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, "called");
}
response = WebUtil.getInstance(context).postURL(_url + "wallet?", args.toString());
info("APIFactory", "XPUB response:" + response);
......@@ -2325,9 +2324,8 @@ public class APIFactory {
args.put("active", StringUtils.join(xpubs, "|"));
info("APIFactory", "XPUB:" + args.toString());
args.put("at", getAccessToken());
if(!PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTXREG, "").equals("ok")) {
if(PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTXREG, false) == false) {
args.put("importPostmixLikeTypeChange", "1");
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, "called");
}
response = WebUtil.getInstance(context).tor_postURL(_url + "wallet", args);
info("APIFactory", "XPUB response:" + response);
......@@ -2534,9 +2532,7 @@ public class APIFactory {
if(isWellFormedMultiAddr(jsonObject)) {
try {
PayloadUtil.getInstance(context).serializeMultiAddrMix(jsonObject);
if(PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTXREG, "").equals("called")) {
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, "ok");
}
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, true);
}
catch(Exception e) {
;
......
......@@ -367,7 +367,7 @@ public class PayloadUtil {
meta.put("user_offline", AppUtil.getInstance(context).isUserOfflineMode());
meta.put("is_sat", PrefsUtil.getInstance(context).getValue(PrefsUtil.IS_SAT, false));
meta.put("localIndexes", LocalReceiveIndexes.getInstance(context).toJSON());
meta.put("xpubpostxreg", PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTREG, ""));
meta.put("xpubpostxreg", PrefsUtil.getInstance(context).getValue(PrefsUtil.XPUBPOSTREG, false));
if(DojoUtil.getInstance(context).getDojoParams() != null) {
meta.put("dojo", DojoUtil.getInstance(context).toJSON());
......@@ -707,7 +707,7 @@ public class PayloadUtil {
LocalReceiveIndexes.getInstance(context).fromJSON((JSONObject) meta.get("localIndexes"));
}
if(meta.has("xpubpostxreg")) {
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, meta.getString("xpubpostxreg"));
PrefsUtil.getInstance(context).setValue(PrefsUtil.XPUBPOSTXREG, meta.getBoolean("xpubpostxreg"));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment