1
0
forked from mirror/misskey

fix(frontend-embed): #14613 で抜け落ちた処理を戻す (#14623)

This commit is contained in:
かっこかり 2024-09-24 19:27:20 +09:00 committed by GitHub
parent 7045547e46
commit c9819babfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<div :class="$style.noteEmbedRoot"> <div :class="$style.noteEmbedRoot">
<EmNoteDetailed v-if="note" :note="note"/> <EmNoteDetailed v-if="note && !prohibited" :note="note"/>
<XNotFound v-else/> <XNotFound v-else/>
</div> </div>
</template> </template>
@ -27,6 +27,8 @@ const serverContext = inject(DI.serverContext)!;
const note = ref<Misskey.entities.Note | null>(null); const note = ref<Misskey.entities.Note | null>(null);
const prohibited = ref(false);
if (assertServerContext(serverContext, 'note')) { if (assertServerContext(serverContext, 'note')) {
note.value = serverContext.note; note.value = serverContext.note;
} else { } else {
@ -36,6 +38,11 @@ if (assertServerContext(serverContext, 'note')) {
return null; return null;
}); });
} }
if (note.value?.url != null || note.value?.uri != null) {
//
prohibited.value = true;
}
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View File

@ -18,6 +18,6 @@ export const userPage = (user: Misskey.Acct, path?: string, absolute = false) =>
return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`; return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
}; };
export const notePage = note => { export const notePage = (note: Misskey.entities.Note) => {
return `/notes/${note.id}`; return `/notes/${note.id}`;
}; };