summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-05-01 13:51:00 +0900
committerGitHub <noreply@github.com>2024-05-01 13:51:00 +0900
commit2017f9114fe281ac86304f3e7956589f43d9ccce (patch)
tree83794780d60ff41ccfcb95d59d642ae6b699d071 /packages/frontend/src/components
parentfix(backend): add detailed schema to `fetch-rss` endpoint (#13764) (diff)
downloadmisskey-2017f9114fe281ac86304f3e7956589f43d9ccce.tar.gz
misskey-2017f9114fe281ac86304f3e7956589f43d9ccce.tar.bz2
misskey-2017f9114fe281ac86304f3e7956589f43d9ccce.zip
refactor(frontend): 非ログイン画面でのmeta取得を減らす (#13776)
* refactor(frontend): 非ログイン画面でのmeta取得を減らす * fix(frontend): サーバー供給のmetaとクライアントフォールバックで取れるmetaの型が違うのを修正 * force fetch meta at welcome.vue * refactor
Diffstat (limited to 'packages/frontend/src/components')
-rw-r--r--packages/frontend/src/components/MkFeaturedPhotos.vue12
-rw-r--r--packages/frontend/src/components/MkVisitorDashboard.vue11
2 files changed, 5 insertions, 18 deletions
diff --git a/packages/frontend/src/components/MkFeaturedPhotos.vue b/packages/frontend/src/components/MkFeaturedPhotos.vue
index 8d875790bc..c42c692db0 100644
--- a/packages/frontend/src/components/MkFeaturedPhotos.vue
+++ b/packages/frontend/src/components/MkFeaturedPhotos.vue
@@ -4,19 +4,11 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<div v-if="meta" :class="$style.root" :style="{ backgroundImage: `url(${ meta.backgroundImageUrl })` }"></div>
+<div v-if="instance" :class="$style.root" :style="{ backgroundImage: `url(${ instance.backgroundImageUrl })` }"></div>
</template>
<script lang="ts" setup>
-import { ref } from 'vue';
-import * as Misskey from 'misskey-js';
-import { misskeyApi } from '@/scripts/misskey-api.js';
-
-const meta = ref<Misskey.entities.MetaResponse>();
-
-misskeyApi('meta', { detail: true }).then(gotMeta => {
- meta.value = gotMeta;
-});
+import { instance } from '@/instance.js';
</script>
<style lang="scss" module>
diff --git a/packages/frontend/src/components/MkVisitorDashboard.vue b/packages/frontend/src/components/MkVisitorDashboard.vue
index be80baa774..611c7be216 100644
--- a/packages/frontend/src/components/MkVisitorDashboard.vue
+++ b/packages/frontend/src/components/MkVisitorDashboard.vue
@@ -4,19 +4,19 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<div v-if="meta" :class="$style.root">
+<div v-if="instance" :class="$style.root">
<div :class="[$style.main, $style.panel]">
<img :src="instance.iconUrl || '/favicon.ico'" alt="" :class="$style.mainIcon"/>
<button class="_button _acrylic" :class="$style.mainMenu" @click="showMenu"><i class="ti ti-dots"></i></button>
<div :class="$style.mainFg">
<h1 :class="$style.mainTitle">
<!-- 背景色によってはロゴが見えなくなるのでとりあえず無効に -->
- <!-- <img class="logo" v-if="meta.logoImageUrl" :src="meta.logoImageUrl"><span v-else class="text">{{ instanceName }}</span> -->
+ <!-- <img class="logo" v-if="instance.logoImageUrl" :src="instance.logoImageUrl"><span v-else class="text">{{ instanceName }}</span> -->
<span>{{ instanceName }}</span>
</h1>
<div :class="$style.mainAbout">
<!-- eslint-disable-next-line vue/no-v-html -->
- <div v-html="meta.description || i18n.ts.headlineMisskey"></div>
+ <div v-html="instance.description || i18n.ts.headlineMisskey"></div>
</div>
<div v-if="instance.disableRegistration" :class="$style.mainWarn">
<MkInfo warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
@@ -66,13 +66,8 @@ import { instance } from '@/instance.js';
import MkNumber from '@/components/MkNumber.vue';
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
-const meta = ref<Misskey.entities.MetaResponse | null>(null);
const stats = ref<Misskey.entities.StatsResponse | null>(null);
-misskeyApi('meta', { detail: true }).then(_meta => {
- meta.value = _meta;
-});
-
misskeyApi('stats', {}).then((res) => {
stats.value = res;
});