see if this works

This commit is contained in:
ThatOneCalculator 2023-04-25 18:21:15 -07:00
parent 8fa0919810
commit a6761ec278
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
3 changed files with 15 additions and 5 deletions

View File

@ -41,7 +41,7 @@ export const meta = {
message: "Cannot find the following.", message: "Cannot find the following.",
code: "CANNOT_FIND", code: "CANNOT_FIND",
id: "7a55f0d7-8e06-4a7e-9c77-ee7d59b25a82", id: "7a55f0d7-8e06-4a7e-9c77-ee7d59b25a82",
} },
}, },
} as const; } as const;

View File

@ -109,13 +109,19 @@ async function renderChart() {
span: "day", span: "day",
}); });
values = raw.deliverFailed; values = raw.deliverFailed;
} else if (props.src === "user-notes") { } else if (props.src === "my-notes") {
const raw = await os.api("charts/user/notes", { const raw = await os.api("charts/user/notes", {
limit: 7 * 21, limit: 7 * 21,
span: "day", span: "day",
userId: $i.id, userId: $i.id,
}); });
values = raw.total; values = raw.diffs.normal.map((_, i) => ({
total:
raw.diffs.normal[i] + raw.diffs.reply[i] + raw.diffs.renote[i],
notes: raw.diffs.normal[i],
replies: raw.diffs.reply[i],
renotes: raw.diffs.renote[i],
}));
} }
fetching = false; fetching = false;

View File

@ -9,12 +9,16 @@
>{{ i18n.ts._widgets.activity }}</template >{{ i18n.ts._widgets.activity }}</template
> >
<template #func <template #func
><button v-if="!widgetProps.newStyle" class="_button" @click="toggleView()"> ><button
v-if="!widgetProps.newStyle"
class="_button"
@click="toggleView()"
>
<i class="ph-sort-ascending ph-bold ph-lg"></i></button <i class="ph-sort-ascending ph-bold ph-lg"></i></button
></template> ></template>
<div v-if="widgetProps.newStyle"> <div v-if="widgetProps.newStyle">
<MkHeatmap src="user-notes" /> <MkHeatmap src="my-notes" />
</div> </div>
<div v-else> <div v-else>
<MkLoading v-if="fetching" /> <MkLoading v-if="fetching" />