@@ -25,9 +25,9 @@ import IntlHelmet from '../../../lib/components/intl-helmet'
25
25
import Message from '../../../lib/components/message'
26
26
import WebhookForm from '../../components/webhook-form'
27
27
import toast from '../../../components/toast'
28
- import Spinner from '../../../components/spinner'
29
28
import diff from '../../../lib/diff'
30
29
import sharedMessages from '../../../lib/shared-messages'
30
+ import withRequest from '../../../lib/components/with-request'
31
31
32
32
import {
33
33
selectSelectedWebhook ,
@@ -70,6 +70,10 @@ const webhookEntitySelector = [
70
70
navigateToList : ( ) => dispatch ( replace ( `/console/applications/${ appId } /integrations` ) ) ,
71
71
}
72
72
} )
73
+ @withRequest (
74
+ ( { getWebhook } ) => getWebhook ( ) ,
75
+ ( { fetching, webhook } ) => fetching || ! Boolean ( webhook )
76
+ )
73
77
@withBreadcrumb ( 'apps.single.integrations.edit' , function ( props ) {
74
78
const { appId, match : { params : { webhookId } } } = props
75
79
return (
@@ -82,11 +86,6 @@ const webhookEntitySelector = [
82
86
} )
83
87
@bind
84
88
export default class ApplicationIntegrationEdit extends Component {
85
- componentDidMount ( ) {
86
- const { getWebhook } = this . props
87
-
88
- getWebhook ( )
89
- }
90
89
91
90
async handleSubmit ( webhook ) {
92
91
const { appId, match : { params : { webhookId } } , webhook : originalWebhook } = this . props
@@ -120,15 +119,7 @@ export default class ApplicationIntegrationEdit extends Component {
120
119
}
121
120
122
121
render ( ) {
123
- const { webhook, fetching, error } = this . props
124
-
125
- if ( fetching || ! webhook ) {
126
- return < Spinner center />
127
- }
128
-
129
- if ( error ) {
130
- throw error
131
- }
122
+ const { webhook } = this . props
132
123
133
124
return (
134
125
< Container >
0 commit comments