parent
7045547e46
commit
c9819babfe
|
@ -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>
|
||||||
|
|
|
@ -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}`;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue