avoid `await` at top-level in setup - fixes frontend tests
This commit is contained in:
parent
19bc4025ea
commit
92cd771e0f
|
@ -22,7 +22,7 @@
|
|||
style-src 'self' 'unsafe-inline';
|
||||
img-src 'self' data: blob: www.google.com xn--931a.moe launcher.moe localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 activitypub.software secure.gravatar.com avatars.githubusercontent.com;
|
||||
media-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000;
|
||||
connect-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 https://newassets.hcaptcha.com;
|
||||
connect-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 https://newassets.hcaptcha.com https://api.listenbrainz.org;
|
||||
frame-src *;"
|
||||
/>
|
||||
<meta property="og:site_name" content="[DEV BUILD] Misskey" />
|
||||
|
|
|
@ -236,8 +236,9 @@ const moderationNote = ref(props.user.moderationNote);
|
|||
const editModerationNote = ref(false);
|
||||
const noteview = ref<string | null>(null);
|
||||
|
||||
let listenbrainzdata = false;
|
||||
const 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',
|
||||
|
@ -247,11 +248,12 @@ if (props.user.listenbrainz) {
|
|||
});
|
||||
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;
|
||||
}
|
||||
})()
|
||||
}
|
||||
|
||||
const background = computed(() => {
|
||||
|
|
Loading…
Reference in New Issue