fix: Cannot display About Firefish page if reaction store is empty

This commit is contained in:
Nanaka Hiira 2024-01-01 21:34:27 +09:00 committed by naskya
parent 7c887421f4
commit a09b8e4d80
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -216,7 +216,7 @@ import MkLink from "@/components/MkLink.vue";
import MkSparkle from "@/components/MkSparkle.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";
@ -235,7 +235,9 @@ 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({