mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-22 00:43:50 +01:00
fix(MisskeyGateway): 処理をクライアント側で行うように
This commit is contained in:
parent
65beae39a4
commit
27408b0d19
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<GMisskeyGateway
|
<GMisskeyGateway
|
||||||
|
v-if="path"
|
||||||
:action="actionConfig"
|
:action="actionConfig"
|
||||||
:branding="{
|
:branding="{
|
||||||
heading: $t('_goToMisskey.heading'),
|
heading: $t('_goToMisskey.heading'),
|
||||||
@ -10,6 +11,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import WindowIco from 'bi/window.svg';
|
import WindowIco from 'bi/window.svg';
|
||||||
|
import { parseQuery } from 'ufo';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'blank',
|
layout: 'blank',
|
||||||
@ -21,19 +23,11 @@ useHead({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const { meta, query } = useRoute();
|
const { meta } = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
// 遷移用パス
|
// 遷移用パス
|
||||||
const path = computed(() => {
|
const path = ref<string | null>(null);
|
||||||
if (!query.path || query.path.length == 0) return undefined;
|
|
||||||
|
|
||||||
if (Array.isArray(query.path)) {
|
|
||||||
return query.path[0] as string;
|
|
||||||
} else {
|
|
||||||
return query.path;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const actionConfig = computed(() => {
|
const actionConfig = computed(() => {
|
||||||
return {
|
return {
|
||||||
@ -42,6 +36,15 @@ const actionConfig = computed(() => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (process.client) {
|
||||||
|
const query = parseQuery(location.search);
|
||||||
|
if (Array.isArray(query.path)) {
|
||||||
|
path.value = query.path[0] as string;
|
||||||
|
} else {
|
||||||
|
path.value = query.path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meta.title = t('_goToMisskey.title');
|
meta.title = t('_goToMisskey.title');
|
||||||
meta.scrollButton = false;
|
meta.scrollButton = false;
|
||||||
</script>
|
</script>
|
@ -7,6 +7,7 @@
|
|||||||
></MkAnimBg>
|
></MkAnimBg>
|
||||||
<GMisskeyGateway
|
<GMisskeyGateway
|
||||||
class="relative"
|
class="relative"
|
||||||
|
v-if="filteredQuery"
|
||||||
:action="{
|
:action="{
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: `/share?${stringifyQuery(filteredQuery)}`,
|
path: `/share?${stringifyQuery(filteredQuery)}`,
|
||||||
@ -16,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { stringifyQuery } from 'ufo';
|
import { stringifyQuery, parseQuery } from 'ufo';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'blank',
|
layout: 'blank',
|
||||||
@ -28,26 +29,36 @@ useHead({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const { meta, query } = useRoute();
|
const { meta } = useRoute();
|
||||||
|
|
||||||
const manualInstance = (Array.isArray(query.manualInstance) ? query.manualInstance[0] : query.manualInstance) ?? undefined;
|
const manualInstance = ref<string | undefined>();
|
||||||
|
|
||||||
const filteredQuery = computed(() => ({
|
const filteredQuery = ref<Record<string, any>>({});
|
||||||
...query,
|
|
||||||
replyId: undefined,
|
|
||||||
renoteId: undefined,
|
|
||||||
visibleUserIds: undefined,
|
|
||||||
fileIds: undefined,
|
|
||||||
manualInstance: undefined,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const isCanvasLoaded = ref(false);
|
const isCanvasLoaded = ref(false);
|
||||||
const showAnimBg = ref(false);
|
const showAnimBg = ref(false);
|
||||||
|
|
||||||
if (process.client && window.innerWidth >= 768) {
|
if (process.client) {
|
||||||
showAnimBg.value = true;
|
const query = parseQuery(location.search.slice(1));
|
||||||
|
|
||||||
|
filteredQuery.value = {
|
||||||
|
...query,
|
||||||
|
replyId: undefined,
|
||||||
|
renoteId: undefined,
|
||||||
|
visibleUserIds: undefined,
|
||||||
|
fileIds: undefined,
|
||||||
|
manualInstance: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
manualInstance.value = Array.isArray(query.manualInstance) ? query.manualInstance[0] : query.manualInstance ?? undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (window.innerWidth >= 768) {
|
||||||
|
showAnimBg.value = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
meta.title = t('_share.title');
|
meta.title = t('_share.title');
|
||||||
|
Loading…
Reference in New Issue
Block a user