Skip to content

Commit

Permalink
fix: ensure that #form-status only sends along error status to #globa…
Browse files Browse the repository at this point in the history
…l-status
  • Loading branch information
tujoworker committed Nov 22, 2019
1 parent 5128c6f commit f380362
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/dnb-ui-lib/src/components/form-status/FormStatus.js
Expand Up @@ -122,19 +122,22 @@ export default class FormStatus extends PureComponent {

// we do not use a random ID here, as we don't need it for now
this._id = props.id || makeUniqueId()
this.gsProvider = GlobalStatusProvider.init(
props.global_status_id || 'main',
provider => {
// gets called once ready
const { text, state } = this.props
const status_id = this._id
provider.add({
state,
status_id,
item: { text, status_id, status_anchor_url: true }
})
}
)

if (props.status !== 'info') {
this.gsProvider = GlobalStatusProvider.init(
props.global_status_id || 'main',
provider => {
// gets called once ready
const { text, state } = this.props
const status_id = this._id
provider.add({
state,
status_id,
item: { text, status_id, status_anchor_url: true }
})
}
)
}

this._ref = React.createRef()
}
Expand Down

0 comments on commit f380362

Please sign in to comment.