diff --git a/packages/webapp/src/configure.ts b/packages/webapp/src/configure.ts index 644fa78..acd4122 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 15fe1b1..5b16d51 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 e904b1b..2a0d8f2 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 1ed2d8c..cb038fe 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 });