diff --git a/www/js/home.js b/www/js/home.js
index 1f82bff..ed7c04a 100644
--- a/www/js/home.js
+++ b/www/js/home.js
@@ -18,7 +18,7 @@ $(".view-main").on("card:open", ".card-expandable", function () {
});
$(".view-main").on("card:closed", "#map-card", function () {
- //leafletgllayer._glMap.setPitch(0);
+ leafletgllayer._glMap.setPitch(0);
leafletmap.invalidateSize();
});
@@ -46,7 +46,7 @@ function loadBalance(callback) {
}
function openMapCard() {
- //leafletgllayer._glMap.setPitch(40);
+ leafletgllayer._glMap.setPitch(20);
leafletmap.invalidateSize();
}
diff --git a/www/js/setup1.js b/www/js/setup1.js
index 00fe498..cdaff0a 100644
--- a/www/js/setup1.js
+++ b/www/js/setup1.js
@@ -8,7 +8,7 @@ $('#username').on("keyup", function () {
$('#username').val($('#username').val().toLowerCase());
});
-function checkAndSave(username, password, type) {
+function checkAndSave(username, password) {
app.preloader.show();
callAPI("getkey", {
@@ -19,10 +19,29 @@ function checkAndSave(username, password, type) {
localStorage.setItem("key", data.key);
localStorage.setItem("username", username);
localStorage.setItem("password", password);
- localStorage.setItem("accttype", type);
- localStorage.setItem("configured", true);
- // Restart the app to re-read the config
- restartApplication();
+ callAPI("getprofile", {
+ key: data.key
+ }, function (profile) {
+ if (profile.profile.type == 1) {
+ localStorage.setItem("accttype", "giver");
+ } else if (profile.profile.type == 2) {
+ localStorage.setItem("accttype", "receiver");
+ } else if (profile.profile.type == 3){
+ app.preloader.hide();
+ app.dialog.alert("You need to download the merchant app instead. Visit ntsm.co/contact if you need help.", "Error");
+ return;
+ } else {
+ app.preloader.hide();
+ app.dialog.alert("Server replied with unknown account type. You might need to update this app.", "Error");
+ return;
+ }
+ localStorage.setItem("configured", true);
+ // Restart the app to re-read the config
+ restartApplication();
+ }, function (msg) {
+ app.preloader.hide();
+ app.dialog.alert(msg, "Error");
+ });
}, function (msg) {
app.preloader.hide();
app.dialog.alert(msg, "Error");
diff --git a/www/pages/home.html b/www/pages/home.html
index 37e9323..9b0f857 100644
--- a/www/pages/home.html
+++ b/www/pages/home.html
@@ -132,7 +132,9 @@
+ {{#if giver}}
+ {{/if}}
\ No newline at end of file