mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix messagepad
This commit is contained in:
4 files changed
+14
-9
No files matched your search
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
"@types/autocannon": "^7.12.6",
|
"@types/autocannon": "^7.12.6",
|
||||||
"@types/chai": "^5.2.1",
|
"@types/chai": "^5.2.1",
|
||||||
"@types/cross-spawn": "^6.0.6",
|
"@types/cross-spawn": "^6.0.6",
|
||||||
"@types/node": "22.13.14",
|
"@types/node": "22.14.1",
|
||||||
"@types/semver": "^7.7.0",
|
"@types/semver": "^7.7.0",
|
||||||
"autocannon": "^8.0.0",
|
"autocannon": "^8.0.0",
|
||||||
"cac": "^6.7.14",
|
"cac": "^6.7.14",
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
"@types/nunjucks": "^3.2.6",
|
"@types/nunjucks": "^3.2.6",
|
||||||
"@types/pickadate": "^3.5.35",
|
"@types/pickadate": "^3.5.35",
|
||||||
"@types/qrcode": "^1.5.5",
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/react": "^18.3.20",
|
"@types/react": "^19.1.2",
|
||||||
"@types/react-dom": "^18.3.6",
|
"@types/react-dom": "^19.1.2",
|
||||||
"@types/redux-logger": "^3.0.13",
|
"@types/redux-logger": "^3.0.13",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@types/webpack-env": "^1.18.8",
|
"@types/webpack-env": "^1.18.8",
|
||||||
|
|||||||
@@ -8,8 +8,13 @@ import { NamedPage } from 'vj/misc/Page';
|
|||||||
import { api, gql, loadReactRedux } from 'vj/utils';
|
import { api, gql, loadReactRedux } from 'vj/utils';
|
||||||
|
|
||||||
class MessagePadService extends Service {
|
class MessagePadService extends Service {
|
||||||
constructor(public store, public WebSocket: typeof import('../components/socket').default) {
|
WebSocket: typeof import('../components/socket').default;
|
||||||
super(ctx, 'messagepad');
|
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;
|
reduxStore = store;
|
||||||
(window as any).store = reduxStore;
|
(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`);
|
const sock = new WebSocket(`${UiContext.ws_prefix}home/messages-conn`);
|
||||||
sock.onmessage = (message) => {
|
sock.onmessage = (message) => {
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.4.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.1.1",
|
"@types/react": "^19.1.2",
|
||||||
"@types/react-dom": "^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"
|
"vite": "^6.2.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user