mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 13:36:44 -06:00
Fix bug
This commit is contained in:
parent
223c578734
commit
7e5dbb2ba5
1 changed files with 22 additions and 1 deletions
|
@ -230,7 +230,7 @@ export default abstract class Chart<T> {
|
||||||
null;
|
null;
|
||||||
|
|
||||||
// ログ取得
|
// ログ取得
|
||||||
const logs = await this.collection.find({
|
let logs = await this.collection.find({
|
||||||
group: group,
|
group: group,
|
||||||
span: span,
|
span: span,
|
||||||
date: {
|
date: {
|
||||||
|
@ -245,6 +245,27 @@ export default abstract class Chart<T> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 要求された範囲にログがひとつもなかったら
|
||||||
|
if (logs.length == 0) {
|
||||||
|
// もっとも新しいログを持ってくる
|
||||||
|
// (すくなくともひとつログが無いと隙間埋めできないため)
|
||||||
|
const recentLog = await this.collection.findOne({
|
||||||
|
group: group,
|
||||||
|
span: span
|
||||||
|
}, {
|
||||||
|
sort: {
|
||||||
|
date: -1
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
_id: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (recentLog) {
|
||||||
|
logs = [recentLog];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 整形
|
// 整形
|
||||||
for (let i = (range - 1); i >= 0; i--) {
|
for (let i = (range - 1); i >= 0; i--) {
|
||||||
const current =
|
const current =
|
||||||
|
|
Loading…
Reference in a new issue