fix (client): unable to open about-firefish if reaction store is empty

This commit is contained in:
Nanaka Hiira 2024-03-02 14:01:05 +09:00 committed by naskya
parent df13c84b53
commit 860bda8921
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -92,7 +92,7 @@ import FormSection from "@/components/form/section.vue";
import MkButton from "@/components/MkButton.vue";
import { physics } from "@/scripts/physics";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
import { defaultStore, defaultReactions } from "@/store";
import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";
@ -103,7 +103,10 @@ const easterEggEngine = ref(null);
const containerEl = ref<HTMLElement>();
function iconLoaded() {
const emojis = defaultStore.state.reactions;
const emojis =
defaultStore.state.reactions.length > 0
? defaultStore.state.reactions
: defaultReactions;
const containerWidth = containerEl.value?.offsetWidth;
for (let i = 0; i < 32; i++) {
easterEggEmojis.value.push({