From 8cbfcedf925c0f9541c431bfedd18a6afb7da266 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 8 Jun 2023 12:40:47 -0700 Subject: [PATCH] old patrons method --- packages/client/src/instance.ts | 9 --------- packages/client/src/pages/about-calckey.vue | 5 ++--- packages/client/src/pages/user/home.vue | 3 ++- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/client/src/instance.ts b/packages/client/src/instance.ts index 4b2c6a953e..69df633e87 100644 --- a/packages/client/src/instance.ts +++ b/packages/client/src/instance.ts @@ -5,8 +5,6 @@ import type * as Misskey from "calckey-js"; // TODO: 他のタブと永続化されたstateを同期 const instanceData = localStorage.getItem("instance"); -const patronData = localStorage.getItem("patrons"); - // TODO: instanceをリアクティブにするかは再考の余地あり export const instance: Misskey.entities.DetailedInstanceMetadata = reactive( @@ -17,8 +15,6 @@ export const instance: Misskey.entities.DetailedInstanceMetadata = reactive( }, ); -export const patrons = patronData || []; - export async function fetchInstance() { const meta = await api("meta", { detail: true, @@ -31,11 +27,6 @@ export async function fetchInstance() { localStorage.setItem("instance", JSON.stringify(instance)); } -export async function fetchPatrons() { - const patrons = await api("patrons"); - localStorage.setItem("patrons", JSON.stringify(patrons)); -} - export const emojiCategories = computed(() => { if (instance.emojis == null) return []; const categories = new Set(); diff --git a/packages/client/src/pages/about-calckey.vue b/packages/client/src/pages/about-calckey.vue index 01350d8403..1e16356a51 100644 --- a/packages/client/src/pages/about-calckey.vue +++ b/packages/client/src/pages/about-calckey.vue @@ -163,15 +163,14 @@ import { i18n } from "@/i18n"; import { defaultStore } from "@/store"; import * as os from "@/os"; import { definePageMetadata } from "@/scripts/page-metadata"; -import { patrons, fetchPatrons } from "@/instance"; + +const patrons = await os.api("patrons"); let easterEggReady = false; let easterEggEmojis = $ref([]); let easterEggEngine = $ref(null); const containerEl = $ref(); -await fetchPatrons() - function iconLoaded() { const emojis = defaultStore.state.reactions; const containerWidth = containerEl?.offsetWidth; diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index 61f3d31687..705a936806 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -353,7 +353,6 @@ import { useRouter } from "@/router"; import { i18n } from "@/i18n"; import { $i } from "@/account"; import { host } from "@/config"; -import { patrons } from "@/instance"; const XPhotos = defineAsyncComponent(() => import("./index.photos.vue")); const XActivity = defineAsyncComponent(() => import("./index.activity.vue")); @@ -368,6 +367,8 @@ const props = withDefaults( const router = useRouter(); +const patrons = await os.api("patrons"); + let parallaxAnimationId = $ref(null); let narrow = $ref(null); let rootEl = $ref(null);