diff --git a/package.json b/package.json index f86d026..bf0cb36 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "dev": "wxt", "dev:firefox": "wxt -b firefox", - "build": "wxt build", + "build": "cross-env NODE_ENV=production run-p build:*", + "build:chorme": "wxt build -b chorme", "build:firefox": "wxt build -b firefox", "pack": "cross-env NODE_ENV=production run-p pack:*", "pack:chrome": "wxt zip -b chrome", diff --git a/src/app/content/index.tsx b/src/app/content/index.tsx index 84edba5..f2047b6 100644 --- a/src/app/content/index.tsx +++ b/src/app/content/index.tsx @@ -22,8 +22,8 @@ export default defineContentScript({ excludeMatches: ['*://localhost/*', '*://127.0.0.1/*'], async main(ctx) { const store = Remesh.store({ - externs: [IndexDBStorageImpl, BrowserSyncStorageImpl, PeerRoomImpl, ToastImpl], - inspectors: __DEV__ ? [RemeshLogger()] : [] + externs: [IndexDBStorageImpl, BrowserSyncStorageImpl, PeerRoomImpl, ToastImpl] + // inspectors: __DEV__ ? [RemeshLogger()] : [] }) const ui = await createShadowRootUi(ctx, { diff --git a/src/domain/Room.ts b/src/domain/Room.ts index c0ad034..16d3410 100644 --- a/src/domain/Room.ts +++ b/src/domain/Room.ts @@ -408,10 +408,10 @@ const RoomDomain = Remesh.domain({ // TODO: Move this to a service worker in the future, so we don't need to send a leave room message every time the page refreshes domain.effect({ name: 'RoomOnUnloadEffect', - impl: () => { + impl: ({ get }) => { const beforeUnload$ = fromEvent(window, 'beforeunload').pipe( map(() => { - return [LeaveRoomCommand()] + return get(RoomJoinStatusModule.query.IsFinishedQuery()) ? LeaveRoomCommand() : null }) ) return beforeUnload$ diff --git a/src/domain/UserInfo.ts b/src/domain/UserInfo.ts index e803492..f7a3329 100644 --- a/src/domain/UserInfo.ts +++ b/src/domain/UserInfo.ts @@ -43,6 +43,8 @@ const UserInfoDomain = Remesh.domain({ const UpdateUserInfoCommand = domain.command({ name: 'UserInfo.UpdateUserInfoCommand', impl: (_, userInfo: UserInfo | null) => { + console.log('111', userInfo) + return [ UserInfoState().new(userInfo), UpdateUserInfoEvent(),