Просмотр исходного кода

ref(js): Remove `async` from component handlers that are not (#35295)

Evan Purkhiser 2 лет назад
Родитель
Сommit
2729613c51

+ 2 - 2
static/app/components/modals/addDashboardWidgetModal.tsx

@@ -275,7 +275,7 @@ class AddDashboardWidgetModal extends Component<Props, State> {
     }
   };
 
-  handleSubmitFromSelectedDashboard = async (
+  handleSubmitFromSelectedDashboard = (
     errors: FlatValidationError,
     widgetData: Widget
   ) => {
@@ -343,7 +343,7 @@ class AddDashboardWidgetModal extends Component<Props, State> {
     }
   };
 
-  handleSubmitFromLibrary = async (errors: FlatValidationError, widgetData: Widget) => {
+  handleSubmitFromLibrary = (errors: FlatValidationError, widgetData: Widget) => {
     const {closeModal, dashboard, onAddLibraryWidget, organization} = this.props;
     if (!dashboard) {
       errors.dashboard = t('This field may not be blank');

+ 1 - 1
static/app/components/search/sources/apiSource.tsx

@@ -327,7 +327,7 @@ class ApiSource extends Component<Props, State> {
   api = new Client();
 
   // Debounced method to handle querying all API endpoints (when necessary)
-  doSearch = debounce(async (query: string) => {
+  doSearch = debounce((query: string) => {
     const {params, organization} = this.props;
     const orgId = (params && params.orgId) || (organization && organization.slug);
     let searchUrls = ['/organizations/'];

+ 1 - 1
static/app/components/smartSearchBar/index.tsx

@@ -1112,7 +1112,7 @@ class SmartSearchBar extends Component<Props, State> {
     }
   };
 
-  updateAutoCompleteItems = async () => {
+  updateAutoCompleteItems = () => {
     window.clearTimeout(this.blurTimeout);
     this.blurTimeout = undefined;
 

+ 1 - 1
static/app/views/eventsV2/results.tsx

@@ -234,7 +234,7 @@ class Results extends Component<Props, State> {
     return null;
   };
 
-  handleConfirmed = async () => {
+  handleConfirmed = () => {
     this.setState({needConfirmation: false, confirmedQuery: true}, () => {
       this.setState({confirmedQuery: false});
     });

+ 1 - 1
static/app/views/organizationIntegrations/integrationListDirectory.tsx

@@ -346,7 +346,7 @@ export class IntegrationListDirectory extends AsyncComponent<
     return displayedList;
   };
 
-  handleSearchChange = async (value: string) => {
+  handleSearchChange = (value: string) => {
     this.setState({searchInput: value}, () => {
       this.updateQueryString();
       const result = this.updateDisplayedList();

+ 2 - 2
static/app/views/performance/transactionSummary/transactionThresholdModal.tsx

@@ -68,7 +68,7 @@ class TransactionThresholdModal extends Component<Props, State> {
     return projects.find(proj => proj.id === projectId);
   }
 
-  handleApply = async (event: React.FormEvent) => {
+  handleApply = (event: React.FormEvent) => {
     event.preventDefault();
 
     const {api, closeModal, organization, transactionName, onApply} = this.props;
@@ -118,7 +118,7 @@ class TransactionThresholdModal extends Component<Props, State> {
     });
   };
 
-  handleReset = async (event: React.FormEvent) => {
+  handleReset = (event: React.FormEvent) => {
     event.preventDefault();
 
     const {api, closeModal, organization, transactionName, onApply} = this.props;

+ 1 - 1
static/app/views/settings/organizationTeams/allTeamsRow.tsx

@@ -33,7 +33,7 @@ class AllTeamsRow extends Component<Props, State> {
     error: false,
   };
 
-  handleRequestAccess = async () => {
+  handleRequestAccess = () => {
     const {team} = this.props;
 
     try {