Skip to content

Commit

Permalink
dismiss all errors at sync start
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Dec 20, 2018
1 parent 0f40d17 commit 3b8036d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/brave_sync/ui/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
export class SyncPage extends React.PureComponent<Props, {}> {
componentDidMount () {
// Inform the back-end that Sync can be loaded
syncActions.onPageLoaded()
this.props.actions.onPageLoaded()
}

render () {
Expand Down
4 changes: 4 additions & 0 deletions components/brave_sync/ui/reducers/sync_reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const syncReducer: Reducer<Sync.State | undefined> = (state: Sync.State | undefi
// inform SyncUIImpl we can start requesting sync settings data
case types.SYNC_ON_PAGE_LOADED:
chrome.send('pageLoaded')
// if there are errors coming from previous views, reset.
if (typeof state.error !== 'undefined') {
state = { ...state, error: undefined }
}
break

case types.SYNC_ON_SHOW_SETTINGS:
Expand Down
3 changes: 2 additions & 1 deletion components/test/brave_sync_ui/components/app_test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as React from 'react'
import { shallow } from 'enzyme'
import { types } from '../../../brave_sync/ui/constants/sync_types'
import { syncInitialState } from '../../testData'
import * as actions from '../../../brave_sync/ui/actions/sync_actions'
import {
SyncPage,
mapStateToProps,
Expand Down Expand Up @@ -44,7 +45,7 @@ describe('sync page component', () => {
it('renders the component', () => {
const wrapper = shallow(
<SyncPage
actions={{}}
actions={actions}
syncData={syncInitialState.syncData as Sync.State}
/>
)
Expand Down

0 comments on commit 3b8036d

Please sign in to comment.