ing
This commit is contained in:
parent
f3f163047b
commit
aae212a9db
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
|||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
|
||||
|
||||
import AppContext from '@overflow/commons/context/AppContext';
|
||||
import Action from '@overflow/commons/redux/Action';
|
||||
|
||||
import ApiKey from '../../api/model/ApiKey';
|
||||
|
@ -17,8 +17,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
|||
// type: types.SENDING_REQUEST,
|
||||
// payload: {sendingRequest: true},
|
||||
// });
|
||||
|
||||
const retApikey = yield call(AppContext.getService<ApiKeyService>().read, domain);
|
||||
let apiKeyService = AppContext.getInstance().getPouch(ApiKeyService);
|
||||
const retApikey = yield call({context: apiKeyService, fn: apiKeyService.read}, domain);
|
||||
|
||||
// if (responseBody.token === undefined) {
|
||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
import * as React from 'react';
|
||||
import { Container, Menu, Sidebar, Segment, Icon, Breadcrumb, Grid, Dropdown } from 'semantic-ui-react';
|
||||
import { Header } from './Header';
|
||||
import { Footer } from './Footer';
|
||||
import LeftMenu from './LeftMenu';
|
||||
|
||||
// import { Routes } from './Routes';
|
||||
|
||||
import routes from '../../router';
|
||||
|
||||
import { Router } from 'react-router';
|
||||
import * as History from 'history';
|
||||
|
||||
import { Provider } from 'react-redux';
|
||||
import { ConnectedRouter } from 'react-router-redux';
|
||||
import { store, sagaMiddleware, history } from '../../redux/store';
|
||||
|
||||
// const history = History.createHashHistory();
|
||||
|
||||
export class Layout extends React.Component<any, any> {
|
||||
|
||||
constructor(props: any, context: any) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
sidebar_visible: true,
|
||||
notification_visible: false,
|
||||
};
|
||||
}
|
||||
|
||||
public onSidebar = () => {
|
||||
this.setState({ notification_visible: !this.state.notification_visible, sidebar_visible: !this.state.sidebar_visible });
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
return (
|
||||
<Container fluid>
|
||||
<LeftMenu />
|
||||
<Segment vertical style={{ margin: '0 0 0 210px', padding: '0' }}>
|
||||
<Header />
|
||||
<Provider store={store}>
|
||||
<ConnectedRouter history={history}>
|
||||
{routes}
|
||||
</ConnectedRouter>
|
||||
</Provider>
|
||||
<Footer />
|
||||
</Segment>
|
||||
</Container >
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -29,6 +29,9 @@ class AppContext {
|
|||
return this._pouchFactory.getPouchByQualifier(type, qualifier, args);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
console.log('AppContext has been destroyed.');
|
||||
}
|
||||
|
||||
public static getInstance(): AppContext {
|
||||
if (undefined === AppContext._instance) {
|
||||
|
|
|
@ -4,12 +4,12 @@ import { call, fork, take } from 'redux-saga/effects';
|
|||
|
||||
import * as LifecycleActions from '../action/lifecycle';
|
||||
|
||||
import AppContext from '../../';
|
||||
import AppContext from '../../AppContext';
|
||||
|
||||
|
||||
function _destroy(): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
AppContext.destroy();
|
||||
AppContext.getInstance().destroy();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user