add withChart prop to UserCardMini

This commit is contained in:
Freeplay 2023-05-19 14:28:36 -04:00
parent b7c83e0725
commit 848739ed84

View File

@ -28,21 +28,28 @@ import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os";
import { acct } from "@/filters/user";
const props = defineProps<{
user: misskey.entities.User;
}>();
const props = withDefaults(defineProps<{
user: misskey.entities.User;
withChart?: boolean;
}>(),
{
withChart: true,
}
);
let chartValues = $ref<number[] | null>(null);
os.apiGet("charts/user/notes", {
userId: props.user.id,
limit: 16 + 1,
span: "day",
}).then((res) => {
//
res.inc.splice(0, 1);
chartValues = res.inc;
});
if (props.withChart) {
os.apiGet("charts/user/notes", {
userId: props.user.id,
limit: 16 + 1,
span: "day",
}).then((res) => {
//
res.inc.splice(0, 1);
chartValues = res.inc;
});
}
</script>
<style lang="scss" module>