Don't load map.js when there's no map, don't assume user chose correct account type
This commit is contained in:
parent
8a85055264
commit
46b0803343
@ -18,7 +18,7 @@ $(".view-main").on("card:open", ".card-expandable", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".view-main").on("card:closed", "#map-card", function () {
|
$(".view-main").on("card:closed", "#map-card", function () {
|
||||||
//leafletgllayer._glMap.setPitch(0);
|
leafletgllayer._glMap.setPitch(0);
|
||||||
leafletmap.invalidateSize();
|
leafletmap.invalidateSize();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ function loadBalance(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openMapCard() {
|
function openMapCard() {
|
||||||
//leafletgllayer._glMap.setPitch(40);
|
leafletgllayer._glMap.setPitch(20);
|
||||||
leafletmap.invalidateSize();
|
leafletmap.invalidateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ $('#username').on("keyup", function () {
|
|||||||
$('#username').val($('#username').val().toLowerCase());
|
$('#username').val($('#username').val().toLowerCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkAndSave(username, password, type) {
|
function checkAndSave(username, password) {
|
||||||
app.preloader.show();
|
app.preloader.show();
|
||||||
|
|
||||||
callAPI("getkey", {
|
callAPI("getkey", {
|
||||||
@ -19,10 +19,29 @@ function checkAndSave(username, password, type) {
|
|||||||
localStorage.setItem("key", data.key);
|
localStorage.setItem("key", data.key);
|
||||||
localStorage.setItem("username", username);
|
localStorage.setItem("username", username);
|
||||||
localStorage.setItem("password", password);
|
localStorage.setItem("password", password);
|
||||||
localStorage.setItem("accttype", type);
|
callAPI("getprofile", {
|
||||||
localStorage.setItem("configured", true);
|
key: data.key
|
||||||
// Restart the app to re-read the config
|
}, function (profile) {
|
||||||
restartApplication();
|
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) {
|
}, function (msg) {
|
||||||
app.preloader.hide();
|
app.preloader.hide();
|
||||||
app.dialog.alert(msg, "Error");
|
app.dialog.alert(msg, "Error");
|
||||||
|
@ -132,7 +132,9 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#if giver}}
|
||||||
<script src="js/map.js"></script>
|
<script src="js/map.js"></script>
|
||||||
|
{{/if}}
|
||||||
<script src="js/home.js"></script>
|
<script src="js/home.js"></script>
|
||||||
|
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user