mirror of
https://github.com/wassname/talk.git
synced 2026-07-28 11:27:05 +08:00
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import {render} from 'react-dom';
|
|
import {ApolloProvider} from 'react-apollo';
|
|
|
|
import {checkLogin} from 'coral-framework/actions/auth';
|
|
import './graphql';
|
|
import {addExternalConfig} from 'coral-embed-stream/src/actions/config';
|
|
import {getStore, injectReducers} from 'coral-framework/services/store';
|
|
import {client} from 'coral-framework/services/client';
|
|
import AppRouter from './AppRouter';
|
|
import {pym} from 'coral-framework';
|
|
import {loadPluginsTranslations, injectPluginsReducers} from 'coral-framework/helpers/plugins';
|
|
import reducers from './reducers';
|
|
|
|
const store = getStore();
|
|
|
|
loadPluginsTranslations();
|
|
injectPluginsReducers();
|
|
injectReducers(reducers);
|
|
|
|
// Don't run this in the popup.
|
|
if (!window.opener) {
|
|
pym.sendMessage('getConfig');
|
|
|
|
pym.onMessage('config', (config) => {
|
|
store.dispatch(addExternalConfig(JSON.parse(config)));
|
|
store.dispatch(checkLogin());
|
|
});
|
|
}
|
|
|
|
render(
|
|
<ApolloProvider client={client} store={store}>
|
|
<AppRouter />
|
|
</ApolloProvider>
|
|
, document.querySelector('#coralStream')
|
|
);
|