small update to home
Some checks failed
Lint / pnpm_install (pull_request) Successful in 43s
API report (misskey.js) / report (pull_request) Successful in 45s
Test (misskey.js) / test (22.x) (pull_request) Successful in 57s
Test (frontend) / vitest (22.x) (pull_request) Successful in 1m23s
Test (production install and build) / production (22.x) (pull_request) Successful in 1m6s
Lint / lint (backend) (pull_request) Successful in 1m3s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 1m30s
Lint / lint (misskey-js) (pull_request) Successful in 33s
Lint / lint (sw) (pull_request) Successful in 29s
Test (backend) / unit (22.x) (pull_request) Successful in 2m34s
Lint / typecheck (misskey-js) (pull_request) Successful in 30s
Lint / typecheck (backend) (pull_request) Successful in 1m21s
Test (backend) / e2e (22.x) (pull_request) Failing after 6m29s
Lint / lint (frontend) (pull_request) Successful in 7m31s

This commit is contained in:
Leah 2025-02-04 16:00:14 +01:00
parent 0c7922edbc
commit 0a0edca5c6

View file

@ -198,6 +198,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkLazy>
<XActivity :key="user.id" :user="user"/>
</MkLazy>
<MkLazy v-if="user.listenbrainz && listenbrainzdata">
<XListenBrainz :key="user.id" :user="user" :collapsed="true"/>
</MkLazy>
</template>
<div v-if="!disableNotes">
<MkLazy>
@ -290,22 +293,24 @@ const moderationNote = ref(props.user.moderationNote);
const editModerationNote = ref(false);
const movedFromLog = ref<null | {movedFromId:string;}[]>(null);
let listenbrainzdata = false;
let listenbrainzdata = ref(false);
if (props.user.listenbrainz) {
(async function() {
try {
const response = await fetch(`https://api.listenbrainz.org/1/user/${props.user.listenbrainz}/playing-now`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
},
});
const data = await response.json();
if (data.payload.listens && data.payload.listens.length !== 0) {
listenbrainzdata = true;
listenbrainzdata.value = true;
}
} catch (err) {
listenbrainzdata = false;
listenbrainzdata.value = false;
}
})();
}
watch(moderationNote, async () => {