embedページとして読み込まれてない場合は非embedページにリダイレクトされるように

This commit is contained in:
kakkokari-gtyih
2024-06-06 19:57:52 +09:00
parent 51366e2940
commit 9a61944331
3 changed files with 27 additions and 3 deletions

View File

@@ -12,17 +12,25 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script setup lang="ts">
import { ref, provide } from 'vue';
import { ref, provide, inject } from 'vue';
import * as Misskey from 'misskey-js';
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
import XNotFound from '@/pages/not-found.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { url } from '@/config.js';
import { useRouter } from '@/router/supplier.js';
const props = defineProps<{
noteId: string;
}>();
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
if (!inEmbedPage) {
const router = useRouter();
router.replace(`/notes/${props.noteId}`);
}
provide('EMBED_ORIGINAL_ENTITY_URL', `${url}/notes/${props.noteId}`);
const note = ref<Misskey.entities.Note | null>(null);