Browse Source

paint get less frequent

schtonn 2 years ago
parent
commit
d2967c2918
2 changed files with 4 additions and 4 deletions
  1. 2 2
      js/paint.js
  2. 2 2
      paint/index.html

+ 2 - 2
js/paint.js

@@ -114,7 +114,7 @@ function getMap() {
     } else {
         const query = new AV.Query('paint');
         query.descending('updatedAt')
-        query.limit(curVer + 1)
+        query.limit(curVer + 6)
         query.find().then((result) => {
             if (result.length > curVer) {
                 console.log('Data loaded from LeanCloud')
@@ -125,7 +125,7 @@ function getMap() {
                 for (let i = 0; i < box.length; i++) {
                     box[i].style.backgroundColor = map[i]
                 }
-                maxVer = curVer
+                maxVer = Math.min(result.length - 1, curVer + 6)
                 maxResult = result
             } else {
                 console.log('Found no data!')

+ 2 - 2
paint/index.html

@@ -1,7 +1,7 @@
 <head>
     <link rel="manifest" href="/site.webmanifest">
-    <link async rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
-        integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
+    <!-- <link async rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
+        integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> -->
     <link rel="stylesheet" href="../css/bootstrap.min.css"
         integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
     <link rel="stylesheet" href="../css/style.css">