1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-27 14:28:53 +09:00

fix storybook build

This commit is contained in:
NoriDev 2023-06-26 17:18:42 +09:00
parent b6979b0437
commit a1a3aee31d

View File

@ -193,7 +193,7 @@
</template>
<script lang="ts" setup>
import { nextTick, onBeforeUnmount } from 'vue';
import { nextTick, onBeforeUnmount, onMounted } from 'vue';
import { version } from '@/config';
import FormLink from '@/components/form/link.vue';
import FormSection from '@/components/form/section.vue';
@ -206,7 +206,6 @@ import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
import { claimAchievement, claimedAchievements } from '@/scripts/achievements';
import { $i } from '@/account';
import { instance } from '@/instance';
const patronsWithIconWithCherryPick = [{
name: 'Inger 잉어',
@ -354,12 +353,6 @@ const patronsWithMisskey = [
];
let isKokonect = false;
const instanceList = [
'http://localhost:3000',
'https://kokonect.link',
'https://beta.kokonect.link',
'https://universe.noridev.moe',
];
let thereIsTreasure = $ref($i && !claimedAchievements.includes('foundTreasure'));
@ -368,8 +361,6 @@ let easterEggEmojis = $ref([]);
let easterEggEngine = $ref(null);
const containerEl = $shallowRef<HTMLElement>();
if (instanceList.includes(<string>instance.uri)) isKokonect = true;
function iconLoaded() {
const emojis = defaultStore.state.reactions;
const containerWidth = containerEl.offsetWidth;
@ -405,6 +396,10 @@ function getTreasure() {
claimAchievement('foundTreasure');
}
onMounted(() => {
if (window.location.host == ('localhost:3000' || 'kokonect.link' || 'beta.kokonect.link' || 'universe.noridev.moe')) isKokonect = true;
})
onBeforeUnmount(() => {
if (easterEggEngine) {
easterEggEngine.stop();