PromucFlow_constructor/app/client/src/pages/Applications/loader.tsx
Nikhil Nandagopal a8001d0356
added tracking for me call and signup / login (#758)
Co-authored-by: Nikhil Nandagopal <nikhil@appsmith.com>
2020-09-28 11:59:41 +05:30

35 lines
907 B
TypeScript

import React from "react";
import PageLoadingBar from "pages/common/PageLoadingBar";
import { retryPromise } from "utils/AppsmithUtils";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
class ApplicationListLoader extends React.PureComponent<any, { Page: any }> {
constructor(props: any) {
super(props);
this.state = {
Page: null,
};
}
componentDidMount() {
PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP);
PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK);
retryPromise(() =>
import(/* webpackChunkName: "applications" */ "./index"),
).then(module => {
this.setState({ Page: module.default });
});
}
render() {
const { Page } = this.state;
return Page ? <Page {...this.props} /> : <PageLoadingBar />;
}
}
export default ApplicationListLoader;