summaryrefslogtreecommitdiffstats
path: root/js/app.js
diff options
context:
space:
mode:
authorrstular <rok@stular.eu>2020-05-16 23:20:42 +0200
committerrstular <rok@stular.eu>2020-05-16 23:20:46 +0200
commitad675cbe9738577b236c5a682e4629c562ee4a76 (patch)
tree91e065c79686654a9b78f3872ea54061eb8ae5a8 /js/app.js
parentBug fix - absences time frame calculations (diff)
downloadbeziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar.gz
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar.bz2
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar.lz
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar.xz
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.tar.zst
beziapp-ad675cbe9738577b236c5a682e4629c562ee4a76.zip
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js39
1 files changed, 21 insertions, 18 deletions
diff --git a/js/app.js b/js/app.js
index 1b39086..79ccf06 100644
--- a/js/app.js
+++ b/js/app.js
@@ -14,17 +14,18 @@ if (navigator.serviceWorker) {
}
/**
- * Displays a user-friendly text to the user and detailed text to developer (console)
+ * Displays a user-friendly text to the user and
+ * detailed text to developer (console)
* @param {string} usermsg User-friendly message
* @param {string} devmsg Developer-friendly message
*/
async function UIAlert(usermsg, devmsg) {
- if(true) { // če bo kakšen dev switch?
- M.toast( { html: usermsg } );
- console.log(`[BežiApp UIAlert] ${usermsg} ${devmsg}`);
- } else {
- M.toast( { html: `${usermsg} ${devmsg}` } );
- }
+ if (true) { // če bo kakšen dev switch?
+ M.toast( { html: usermsg } );
+ console.log(`[BežiApp UIAlert] ${usermsg} ${devmsg}`);
+ } else {
+ M.toast( { html: `${usermsg} ${devmsg}` } );
+ }
}
/**
@@ -32,15 +33,17 @@ async function UIAlert(usermsg, devmsg) {
* @param {Object} err GSEC error object
*/
function gsecErrorHandlerUI(err) {
- console.log(`gsecErrorHanderUI: handling ${err}`);
- if(err == GSEC_ERR_NET || err == GSEC_ERR_NET_POSTBACK_GET || err == GSEC_ERR_NET_POSTBACK_POST) {
- UIAlert( D("gsecErrNet") );
- } else if(err == GSEC_ERR_LOGIN) {
- UIAlert( D("gsecErrLogin") );
- localforage.setItem("logged_in", false).then( () => {
- window.location.replace("/index.html");
- });
- } else {
- UIAlert( D("gsecErrOther") );
- }
+ console.log(`gsecErrorHanderUI: handling ${err}`);
+ if(err == GSEC_ERR_NET || err == GSEC_ERR_NET_POSTBACK_GET ||
+ err == GSEC_ERR_NET_POSTBACK_POST) {
+
+ UIAlert( D("gsecErrNet") );
+ } else if(err == GSEC_ERR_LOGIN) {
+ UIAlert( D("gsecErrLogin") );
+ localforage.setItem("logged_in", false).then( () => {
+ window.location.replace("/index.html");
+ });
+ } else {
+ UIAlert( D("gsecErrOther") );
+ }
}