Send the 25 last messages for each channel to the client on load
This commit is contained in:
parent
c840d51e16
commit
eedc687f18
26 changed files with 300 additions and 268 deletions
|
@ -10,6 +10,7 @@ import createRoutes from './routes';
|
|||
import Socket from './util/Socket';
|
||||
import handleSocket from './socket';
|
||||
import Root from './containers/Root';
|
||||
import { addMessages } from './actions/message';
|
||||
|
||||
const host = DEV ? `${window.location.hostname}:1337` : window.location.host;
|
||||
const socket = new Socket(host);
|
||||
|
@ -46,6 +47,11 @@ if (env.users) {
|
|||
});
|
||||
}
|
||||
|
||||
if (env.messages) {
|
||||
const { messages, server, to } = env.messages;
|
||||
store.dispatch(addMessages(messages, server, to));
|
||||
}
|
||||
|
||||
handleSocket(socket, store);
|
||||
|
||||
const routes = createRoutes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue