Skip to content

Commit

Permalink
Fixed homepage import <app-root>
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Oct 26, 2023
1 parent fae39b1 commit 167826a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion packages/webapp/src/configure.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
});
4 changes: 4 additions & 0 deletions packages/webapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,7 @@ if (COMMAND === 'build') {
} else {
navigator.serviceWorker?.getRegistration().then((reg) => reg?.unregister());
}

addEventListener('load', () => {
logger.info('Loaded!');
});
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 1 addition & 5 deletions packages/webapp/src/modules/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
connectStore,
attribute,
history,
createStore,
updateStore,
} from '@mantou/gem';
import { mediaQuery } from '@mantou/gem/helper/mediaquery';
Expand All @@ -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';
Expand Down Expand Up @@ -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 });

Expand Down

0 comments on commit 167826a

Please sign in to comment.