ui: fix messagepad

This commit is contained in:
undefined committed 2025-04-16 10:09:45 +08:00
1 parent 50d0536a3b
commit b979185fd8
4 files changed
+14 -9

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@
"@types/autocannon": "^7.12.6",
"@types/chai": "^5.2.1",
"@types/cross-spawn": "^6.0.6",
"@types/node": "22.13.14",
"@types/node": "22.14.1",
"@types/semver": "^7.7.0",
"autocannon": "^8.0.0",
"cac": "^6.7.14",
+2 -2
View File
@@ -34,8 +34,8 @@
"@types/nunjucks": "^3.2.6",
"@types/pickadate": "^3.5.35",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/redux-logger": "^3.0.13",
"@types/uuid": "^10.0.0",
"@types/webpack-env": "^1.18.8",
@@ -8,8 +8,13 @@ import { NamedPage } from 'vj/misc/Page';
import { api, gql, loadReactRedux } from 'vj/utils';
class MessagePadService extends Service {
constructor(public store, public WebSocket: typeof import('../components/socket').default) {
super(ctx, 'messagepad');
WebSocket: typeof import('../components/socket').default;
store: any;
constructor(c, s) {
super(c, 'messagepad');
this.WebSocket = s.WebSocket;
this.store = s.store;
}
}
@@ -43,7 +48,7 @@ const page = new NamedPage('home_messages', () => {
reduxStore = store;
(window as any).store = reduxStore;
ctx.provide('messagepad', new MessagePadService(store, WebSocket));
ctx.plugin(MessagePadService, { store, WebSocket });
const sock = new WebSocket(`${UiContext.ws_prefix}home/messages-conn`);
sock.onmessage = (message) => {
+3 -3
View File
@@ -8,14 +8,14 @@
"preview": "vite preview"
},
"dependencies": {
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^4.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^19.1.1",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react-swc": "^3.8.1",
"@vitejs/plugin-react-swc": "^3.9.0",
"vite": "^6.2.6"
}
}