mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-12 01:01:25 +09:00
fetch past 21 weeks for activity widgets
This commit is contained in:
parent
6d44263ae7
commit
d5b9fa6a33
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<svg :viewBox="`0 0 ${weeks} 7`">
|
||||
<svg :viewBox="`0 0 21 7`">
|
||||
<rect v-for="record in data" class="day"
|
||||
width="1" height="1"
|
||||
:x="record.x" :y="record.date.weekday"
|
||||
@ -28,11 +28,6 @@ import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['data'],
|
||||
data() {
|
||||
return {
|
||||
weeks: 21
|
||||
};
|
||||
},
|
||||
created() {
|
||||
for (const d of this.data) {
|
||||
d.total = d.notes + d.replies + d.renotes;
|
||||
@ -43,9 +38,8 @@ export default Vue.extend({
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
const day = now.getDate();
|
||||
if (now.getDay() == 6) this.weeks = 20;
|
||||
|
||||
let x = this.weeks - 1;
|
||||
let x = 20;
|
||||
this.data.slice().forEach((d, i) => {
|
||||
d.x = x;
|
||||
|
||||
|
@ -46,7 +46,7 @@ export default Vue.extend({
|
||||
props: ['data'],
|
||||
data() {
|
||||
return {
|
||||
viewBoxX: 140,
|
||||
viewBoxX: 147,
|
||||
viewBoxY: 60,
|
||||
zoom: 1,
|
||||
pos: 0,
|
||||
|
@ -48,7 +48,7 @@ export default Vue.extend({
|
||||
this.$root.api('charts/user/notes', {
|
||||
userId: this.user.id,
|
||||
span: 'day',
|
||||
limit: 7 * 20
|
||||
limit: 7 * 21
|
||||
}).then(activity => {
|
||||
this.activity = activity.diffs.normal.map((_, i) => ({
|
||||
total: activity.diffs.normal[i] + activity.diffs.reply[i] + activity.diffs.renote[i],
|
||||
|
Loading…
Reference in New Issue
Block a user