Skip to content

Commit

Permalink
fix(frontend-embed): misskey-dev#14613 で抜け落ちた処理を戻す
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Sep 24, 2024
1 parent 4be307f commit 58cdc0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/frontend-embed/src/pages/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<div :class="$style.noteEmbedRoot">
<EmNoteDetailed v-if="note" :note="note"/>
<EmNoteDetailed v-if="note && !prohibited" :note="note"/>
<XNotFound v-else/>
</div>
</template>
Expand All @@ -27,6 +27,8 @@ const serverContext = inject(DI.serverContext)!;

const note = ref<Misskey.entities.Note | null>(null);

const prohibited = ref(false);

if (assertServerContext(serverContext, 'note')) {
note.value = serverContext.note;
} else {
Expand All @@ -36,6 +38,11 @@ if (assertServerContext(serverContext, 'note')) {
return null;
});
}

if (note.value?.url != null || note.value?.uri != null) {
// リモートサーバーのノートは弾く
prohibited.value = true;
}
</script>

<style lang="scss" module>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export const userPage = (user: Misskey.Acct, path?: string, absolute = false) =>
return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
};

export const notePage = note => {
export const notePage = (note: Misskey.entities.Note) => {
return `/notes/${note.id}`;
};

0 comments on commit 58cdc0c

Please sign in to comment.