Skip to content

Commit 0b1d814

Browse files
author
Bogdans Afonins
committed
console: Fix app integrations error handling
check for error only after the _REQUEST action
1 parent 2b05eb9 commit 0b1d814

File tree

1 file changed

+6
-15
lines changed
  • pkg/webui/console/views/application-integration-edit

1 file changed

+6
-15
lines changed

pkg/webui/console/views/application-integration-edit/index.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import IntlHelmet from '../../../lib/components/intl-helmet'
2525
import Message from '../../../lib/components/message'
2626
import WebhookForm from '../../components/webhook-form'
2727
import toast from '../../../components/toast'
28-
import Spinner from '../../../components/spinner'
2928
import diff from '../../../lib/diff'
3029
import sharedMessages from '../../../lib/shared-messages'
30+
import withRequest from '../../../lib/components/with-request'
3131

3232
import {
3333
selectSelectedWebhook,
@@ -70,6 +70,10 @@ const webhookEntitySelector = [
7070
navigateToList: () => dispatch(replace(`/console/applications/${appId}/integrations`)),
7171
}
7272
})
73+
@withRequest(
74+
({ getWebhook }) => getWebhook(),
75+
({ fetching, webhook }) => fetching || !Boolean(webhook)
76+
)
7377
@withBreadcrumb('apps.single.integrations.edit', function (props) {
7478
const { appId, match: { params: { webhookId }}} = props
7579
return (
@@ -82,11 +86,6 @@ const webhookEntitySelector = [
8286
})
8387
@bind
8488
export default class ApplicationIntegrationEdit extends Component {
85-
componentDidMount () {
86-
const { getWebhook } = this.props
87-
88-
getWebhook()
89-
}
9089

9190
async handleSubmit (webhook) {
9291
const { appId, match: { params: { webhookId }}, webhook: originalWebhook } = this.props
@@ -120,15 +119,7 @@ export default class ApplicationIntegrationEdit extends Component {
120119
}
121120

122121
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
132123

133124
return (
134125
<Container>

0 commit comments

Comments
 (0)