]> source.dussan.org Git - gitea.git/commitdiff
Fix heatmap total contributions (#14141)
authorLunny Xiao <xiaolunwen@gmail.com>
Thu, 24 Dec 2020 20:58:30 +0000 (04:58 +0800)
committerGitHub <noreply@github.com>
Thu, 24 Dec 2020 20:58:30 +0000 (20:58 +0000)
web_src/js/components/ActivityHeatmap.vue

index 943bf704e28117b6c2e093f3168a380d0aee927a..7eb129d1397bd4005a90d3f32ea819f715106ae7 100644 (file)
@@ -1,7 +1,7 @@
 <template>
   <div id="user-heatmap">
     <div class="total-contributions">
-      {{ values.length }} contributions in the last 12 months
+      {{ sum }} contributions in the last 12 months
     </div>
     <calendar-heatmap
       :locale="locale"
@@ -40,6 +40,15 @@ export default {
       no_contributions: 'No contributions',
     },
   }),
+  computed: {
+    sum() {
+      let s = 0;
+      for (let i = 0; i < this.values.length; i++) {
+        s += this.values[i].count;
+      }
+      return s;
+    }
+  }
 };
 </script>
 <style scoped/>