mirror of
https://github.com/misskey-dev/misskey
synced 2024-12-13 06:09:05 +09:00
内部routerで遷移した場合には正規ページに転送するように
This commit is contained in:
parent
9a61944331
commit
6fdb004d48
@ -40,7 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, shallowRef, inject } from 'vue';
|
import { ref, computed, shallowRef, inject, onActivated } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
import XNotFound from '@/pages/not-found.vue';
|
import XNotFound from '@/pages/not-found.vue';
|
||||||
@ -60,12 +60,16 @@ const props = defineProps<{
|
|||||||
enableAutoLoad?: string;
|
enableAutoLoad?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
function redirectIfNotEmbedPage() {
|
||||||
|
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
||||||
|
|
||||||
if (!inEmbedPage) {
|
if (!inEmbedPage) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.replace(`/clips/${props.clipId}`);
|
router.replace(`/clips/${props.clipId}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
redirectIfNotEmbedPage();
|
||||||
|
onActivated(redirectIfNotEmbedPage);
|
||||||
|
|
||||||
// デフォルト: true
|
// デフォルト: true
|
||||||
const normalizedShowHeader = computed(() => props.showHeader !== 'false');
|
const normalizedShowHeader = computed(() => props.showHeader !== 'false');
|
||||||
|
@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, provide, inject } from 'vue';
|
import { ref, provide, inject, onActivated } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||||
import XNotFound from '@/pages/not-found.vue';
|
import XNotFound from '@/pages/not-found.vue';
|
||||||
@ -24,12 +24,16 @@ const props = defineProps<{
|
|||||||
noteId: string;
|
noteId: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
function redirectIfNotEmbedPage() {
|
||||||
|
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
||||||
|
|
||||||
if (!inEmbedPage) {
|
if (!inEmbedPage) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.replace(`/notes/${props.noteId}`);
|
router.replace(`/notes/${props.noteId}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
redirectIfNotEmbedPage();
|
||||||
|
onActivated(redirectIfNotEmbedPage);
|
||||||
|
|
||||||
provide('EMBED_ORIGINAL_ENTITY_URL', `${url}/notes/${props.noteId}`);
|
provide('EMBED_ORIGINAL_ENTITY_URL', `${url}/notes/${props.noteId}`);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, shallowRef, inject } from 'vue';
|
import { ref, computed, shallowRef, inject, onActivated } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
import XNotFound from '@/pages/not-found.vue';
|
import XNotFound from '@/pages/not-found.vue';
|
||||||
@ -66,12 +66,16 @@ const props = defineProps<{
|
|||||||
enableAutoLoad?: string;
|
enableAutoLoad?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
function redirectIfNotEmbedPage() {
|
||||||
|
const inEmbedPage = inject<boolean>('EMBED_PAGE', false);
|
||||||
|
|
||||||
if (!inEmbedPage) {
|
if (!inEmbedPage) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.replace(`/@${props.username}`);
|
router.replace(`/@${props.username}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
redirectIfNotEmbedPage();
|
||||||
|
onActivated(redirectIfNotEmbedPage);
|
||||||
|
|
||||||
// デフォルト: true
|
// デフォルト: true
|
||||||
const normalizedShowHeader = computed(() => props.showHeader !== 'false');
|
const normalizedShowHeader = computed(() => props.showHeader !== 'false');
|
||||||
|
Loading…
Reference in New Issue
Block a user