From 0e3022860b54f1a65f0c4d9b762ef1ec0a2a2682 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:27:32 +0900 Subject: [PATCH] wip --- .../src/components/EmNoteDetailed.vue | 4 ++-- packages/frontend-embed/src/instance.ts | 15 --------------- packages/frontend-embed/src/pages/clip.vue | 6 +++--- packages/frontend-embed/src/pages/tag.vue | 6 +++--- .../frontend-embed/src/pages/user-timeline.vue | 4 ++-- packages/frontend-embed/src/server-metadata.ts | 15 +++++++++++++++ packages/frontend-shared/js/i18n.ts | 10 ++++++---- 7 files changed, 31 insertions(+), 29 deletions(-) delete mode 100644 packages/frontend-embed/src/instance.ts create mode 100644 packages/frontend-embed/src/server-metadata.ts diff --git a/packages/frontend-embed/src/components/EmNoteDetailed.vue b/packages/frontend-embed/src/components/EmNoteDetailed.vue index cc9be13a57..e494462f86 100644 --- a/packages/frontend-embed/src/components/EmNoteDetailed.vue +++ b/packages/frontend-embed/src/components/EmNoteDetailed.vue @@ -50,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- +
@@ -142,7 +142,7 @@ import { userPage } from '@/utils.js'; import { notePage } from '@/utils.js'; import { i18n } from '@/i18n.js'; import { shouldCollapsed } from '@/to-be-shared/collapsed.js'; -import { instance } from '@/server-metadata.js'; +import { serverMetadata } from '@/server-metadata.js'; import { url } from '@/config.js'; import EmMfm from '@/components/EmMfm.js'; diff --git a/packages/frontend-embed/src/instance.ts b/packages/frontend-embed/src/instance.ts deleted file mode 100644 index 970364667a..0000000000 --- a/packages/frontend-embed/src/instance.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { misskeyApi } from '@/misskey-api.js'; - -const providedMetaEl = document.getElementById('misskey_meta'); - -const _instance = (providedMetaEl && providedMetaEl.textContent) ? JSON.parse(providedMetaEl.textContent) : null; - -// NOTE: devモードのときしか _instance が null になることは無い -export const instance = _instance ?? await misskeyApi('meta', { - detail: true, -}); diff --git a/packages/frontend-embed/src/pages/clip.vue b/packages/frontend-embed/src/pages/clip.vue index bb4f8bf7c5..9cf145d335 100644 --- a/packages/frontend-embed/src/pages/clip.vue +++ b/packages/frontend-embed/src/pages/clip.vue @@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -41,6 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only