Skip to content

Commit

Permalink
Merge pull request #1128 from brave/ca-2577
Browse files Browse the repository at this point in the history
show message about server error when sync is active
  • Loading branch information
cezaraugusto committed Dec 18, 2018
1 parent 1d317a7 commit 11b8271
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion components/brave_sync/ui/components/enabledContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as React from 'react'

// Components
import { Button } from 'brave-ui'
import { Button, AlertBox } from 'brave-ui'
import Table, { Cell, Row } from 'brave-ui/components/dataTables/table'
import { Toggle } from 'brave-ui/features/shields'

Expand Down Expand Up @@ -111,6 +111,10 @@ export default class SyncEnabledContent extends React.PureComponent<Props, State
})
}

onUserNoticedError = () => {
this.props.actions.resetSyncSetupError()
}

onClickViewSyncCodeButton = () => {
this.setState({ viewSyncCode: !this.state.viewSyncCode })
}
Expand Down Expand Up @@ -144,6 +148,22 @@ export default class SyncEnabledContent extends React.PureComponent<Props, State

return (
<Main>
{
syncData.error === 'ERR_SYNC_NO_INTERNET'
? <AlertBox okString={getLocale('ok')} onClickOk={this.onUserNoticedError}>
<Title>{getLocale('errorNoInternetTitle')}</Title>
<SubTitle>{getLocale('errorNoInternetDescription')}</SubTitle>
</AlertBox>
: null
}
{
syncData.error === 'ERR_SYNC_INIT_FAILED'
? <AlertBox okString={getLocale('ok')} onClickOk={this.onUserNoticedError}>
<Title>{getLocale('errorSyncInitFailedTitle')}</Title>
<SubTitle>{getLocale('errorSyncInitFailedDescription')}</SubTitle>
</AlertBox>
: null
}
{
removeDevice
? <RemoveDeviceModal
Expand Down

0 comments on commit 11b8271

Please sign in to comment.