From 167826a79ea91ba14e9814944abb5b9054bdc906 Mon Sep 17 00:00:00 2001 From: mantou132 <709922234@qq.com> Date: Wed, 25 Oct 2023 17:48:13 +0800 Subject: [PATCH] Fixed homepage import `` --- packages/webapp/src/configure.ts | 6 +++++- packages/webapp/src/index.ts | 4 ++++ packages/webapp/src/modules/meta.ts | 2 +- packages/webapp/src/modules/nav.ts | 6 +----- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/webapp/src/configure.ts b/packages/webapp/src/configure.ts index 644fa78e..acd41229 100644 --- a/packages/webapp/src/configure.ts +++ b/packages/webapp/src/configure.ts @@ -1,4 +1,4 @@ -import { updateStore } from '@mantou/gem'; +import { createStore, updateStore } from '@mantou/gem'; import { isMac, getDisplayKey } from 'duoyun-ui/lib/hotkeys'; import { Modify } from 'duoyun-ui/lib/types'; import { createCacheStore } from 'duoyun-ui/lib/utils'; @@ -235,3 +235,7 @@ export const setSearchCommand = (command: SearchCommand | null) => { export const setNesFile = (file?: File) => { updateStore(configure, { openNesFile: file }); }; + +export const navStore = createStore({ + room: false, +}); diff --git a/packages/webapp/src/index.ts b/packages/webapp/src/index.ts index 15fe1b12..5b16d51f 100644 --- a/packages/webapp/src/index.ts +++ b/packages/webapp/src/index.ts @@ -219,3 +219,7 @@ if (COMMAND === 'build') { } else { navigator.serviceWorker?.getRegistration().then((reg) => reg?.unregister()); } + +addEventListener('load', () => { + logger.info('Loaded!'); +}); diff --git a/packages/webapp/src/modules/meta.ts b/packages/webapp/src/modules/meta.ts index e904b1b7..2a0d8f29 100644 --- a/packages/webapp/src/modules/meta.ts +++ b/packages/webapp/src/modules/meta.ts @@ -4,7 +4,7 @@ import { mediaQuery } from '@mantou/gem/helper/mediaquery'; import { i18n } from 'src/i18n/basic'; import { themeStore } from 'src/theme'; import { isSafari } from 'src/constants'; -import { navStore } from 'src/modules/nav'; +import { navStore } from 'src/configure'; import 'duoyun-ui/elements/title'; import 'duoyun-ui/elements/reflect'; diff --git a/packages/webapp/src/modules/nav.ts b/packages/webapp/src/modules/nav.ts index 1ed2d8c1..cb038fe0 100644 --- a/packages/webapp/src/modules/nav.ts +++ b/packages/webapp/src/modules/nav.ts @@ -8,7 +8,6 @@ import { connectStore, attribute, history, - createStore, updateStore, } from '@mantou/gem'; import { mediaQuery } from '@mantou/gem/helper/mediaquery'; @@ -27,6 +26,7 @@ import { toggleFriendListState, toggleSearchState, toggleSideNavState, + navStore, } from 'src/configure'; import { theme } from 'src/theme'; import { createRoom, favoriteGame, leaveRoom } from 'src/services/api'; @@ -127,10 +127,6 @@ const style = createCSSSheet(css` } `); -export const navStore = createStore({ - room: false, -}); - export const mountedRoom = () => updateStore(navStore, { room: true }); export const unmountedRoom = () => updateStore(navStore, { room: false });