]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Replace "fuck" with "ajax_failure"
authorMichal <michal.sojka@cvut.cz>
Wed, 15 Aug 2018 10:14:06 +0000 (12:14 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 16 Aug 2018 20:57:30 +0000 (22:57 +0200)
It makes the reason of the data structure clearer :-)

templates/main.js

index b55fbb5c12d047d0635e5d24b2cf5075deea613a..7160868d34a5be9e0b2b1152d48632b5273adb46 100644 (file)
@@ -74,7 +74,7 @@ function hiddenUpdateRemote(json) {
                 addCoffee(flavor);
             }
             break;
-        case "fuck":
+        case "ajax_failure":
             ajax(msg.method, msg.route, msg.data, msg.id);
             break;
     }
@@ -115,15 +115,15 @@ function ajax(method, route, data, id) {
                 updateUI();
 
                 if (localStorage) {
-                    var fuck = JSON.stringify({
-                        type: "fuck",
+                    var ajax_failure = JSON.stringify({
+                        type: "ajax_failure",
                         method: method,
                         route: route,
                         data: data,
                         id: id
                     });
                     let queue = JSON.parse(localStorage.getItem("offlineQueue")) || [];
-                    queue.push({ time: Date.now(), data: fuck });
+                    queue.push({ time: Date.now(), data: ajax_failure });
                     try {
                         localStorage.setItem("offlineQueue", JSON.stringify(queue));
                     }