old patrons method

This commit is contained in:
ThatOneCalculator 2023-06-08 12:40:47 -07:00
parent 141084d56c
commit a527d3da1b
3 changed files with 4 additions and 13 deletions

View File

@ -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();

View File

@ -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<HTMLElement>();
await fetchPatrons()
function iconLoaded() {
const emojis = defaultStore.state.reactions;
const containerWidth = containerEl?.offsetWidth;

View File

@ -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 | number>(null);
let narrow = $ref<null | boolean>(null);
let rootEl = $ref<null | HTMLElement>(null);