// @flow
import React, { Component } from 'react';
import { FormModel } from 'components/ui/form';
import ApplicationForm from 'components/dev/apps/applicationForm/ApplicationForm';
import { browserHistory } from 'services/history';
import oauth from 'services/api/oauth';
import loader from 'services/loader';
import PageNotFound from 'pages/404/PageNotFound';
import type { OauthAppResponse } from 'services/api/oauth';
type MatchType = {
match: {
params: {
clientId: string,
},
},
};
class UpdateApplicationPage extends Component<{
app: ?OauthAppResponse,
fetchApp: (string) => Promise<*>,
} & MatchType, {
isNotFound: bool,
}> {
static displayName = 'UpdateApplicationPage';
form = new FormModel();
state = {
isNotFound: false,
};
componentWillMount() {
this.props.app === null && this.fetchApp();
}
render() {
const { app } = this.props;
if (this.state.isNotFound) {
return (