Browse Source

stop the sync when opening the Clean/Reset modals

develop
Gaëtan Renaudeau 6 years ago
parent
commit
51e9dfb320
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 5
      src/components/SettingsPage/CleanButton.js
  2. 5
      src/components/SettingsPage/ResetButton.js
  3. 2
      src/components/base/Modal/ConfirmModal.js

5
src/components/SettingsPage/CleanButton.js

@ -6,6 +6,7 @@ import { translate } from 'react-i18next'
import logger from 'logger'
import type { T } from 'types/common'
import { cleanAccountsCache } from 'actions/accounts'
import SyncSkipUnderPriority from 'components/SyncSkipUnderPriority'
import Button from 'components/base/Button'
import ConfirmModal from 'components/base/Modal/ConfirmModal'
import { softReset } from 'helpers/reset'
@ -69,7 +70,9 @@ class CleanButton extends PureComponent<Props, State> {
title={t('settings.softResetModal.title')}
subTitle={t('common.areYouSure')}
desc={t('settings.softResetModal.desc')}
/>
>
<SyncSkipUnderPriority priority={999} />
</ConfirmModal>
<ResetFallbackModal isOpened={fallbackOpened} onClose={this.closeFallback} />
</Fragment>

5
src/components/SettingsPage/ResetButton.js

@ -7,6 +7,7 @@ import { translate } from 'react-i18next'
import logger from 'logger'
import type { T } from 'types/common'
import { hardReset } from 'helpers/reset'
import SyncSkipUnderPriority from 'components/SyncSkipUnderPriority'
import Box from 'components/base/Box'
import Button from 'components/base/Button'
import ConfirmModal from 'components/base/Modal/ConfirmModal'
@ -73,7 +74,9 @@ class ResetButton extends PureComponent<Props, State> {
<IconTriangleWarning width={23} height={21} />
</IconWrapperCircle>
)}
/>
>
<SyncSkipUnderPriority priority={999} />
</ConfirmModal>
<ResetFallbackModal isOpened={fallbackOpened} onClose={this.closeFallback} />
</Fragment>

2
src/components/base/Modal/ConfirmModal.js

@ -50,6 +50,7 @@ class ConfirmModal extends PureComponent<Props> {
t,
analyticsName,
centered,
children,
...props
} = this.props
@ -91,6 +92,7 @@ class ConfirmModal extends PureComponent<Props> {
<Box ff="Open Sans" color="smoke" fontSize={4} textAlign="center">
{desc}
</Box>
{children}
</Box>
)}
/>

Loading…
Cancel
Save