Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Ensure sqlite folder is removed after clear cache / hard reset #1585

Merged
merged 3 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/SettingsPage/CleanButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { Fragment, PureComponent } from 'react'
import { connect } from 'react-redux'
import { translate } from 'react-i18next'
import logger from 'logger'
import type { T } from 'types/common'
import { cleanAccountsCache } from 'actions/accounts'
import Button from 'components/base/Button'
Expand Down Expand Up @@ -43,6 +44,7 @@ class CleanButton extends PureComponent<Props, State> {
this.setState({ isLoading: true })
await softReset({ cleanAccountsCache: this.props.cleanAccountsCache })
} catch (err) {
meriadec marked this conversation as resolved.
Show resolved Hide resolved
logger.error(err)
this.setState({ isLoading: false, fallbackOpened: true })
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/SettingsPage/ResetButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { Fragment, PureComponent } from 'react'
import styled from 'styled-components'
import { remote } from 'electron'
import { translate } from 'react-i18next'
import logger from 'logger'
import type { T } from 'types/common'
import { hardReset } from 'helpers/reset'
import Box from 'components/base/Box'
Expand Down Expand Up @@ -39,6 +40,7 @@ class ResetButton extends PureComponent<Props, State> {
await hardReset()
remote.getCurrentWindow().webContents.reloadIgnoringCache()
} catch (err) {
logger.error(err)
this.setState({ pending: false, fallbackOpened: true })
meriadec marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down
18 changes: 11 additions & 7 deletions src/components/SettingsPage/ResetFallbackModal.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// @flow

import React, { PureComponent } from 'react'
import { translate } from 'react-i18next'

import { ConfirmModal } from 'components/base/Modal'
import { openUserDataFolderAndQuit } from 'helpers/reset'

type Props = {
t: *,
isOpened: boolean,
onClose: () => *,
}

class ResetFallbackModal extends PureComponent<Props> {
render() {
const { isOpened, onClose } = this.props
const { t, isOpened, onClose } = this.props
return (
<ConfirmModal
centered
Expand All @@ -24,18 +26,20 @@ class ResetFallbackModal extends PureComponent<Props> {
title="Couldnt remove app files"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title="User action required"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

desc={
<div>
<p>{'Cache folder couldnt be deleted. You will have to delete it manually.'}</p>
<p>{t('settings.resetFallbackModal.part1')}</p>
<p style={{ fontWeight: 'bold' }}>
{'Click on "Open folder", then the '}
<span style={{ textDecoration: 'underline' }}>{'app will close'}</span>
{', and you will have to delete the "sqlite" folder.'}
{t('settings.resetFallbackModal.part2')}
<span style={{ textDecoration: 'underline' }}>
{t('settings.resetFallbackModal.part3')}
</span>
{t('settings.resetFallbackModal.part4')}
</p>
<p style={{ marginTop: 20 }}>{'After that, you can restart the app.'}</p>
<p style={{ marginTop: 20 }}>{t('settings.resetFallbackModal.part5')}</p>
</div>
}
/>
)
}
}

export default ResetFallbackModal
export default translate()(ResetFallbackModal)
7 changes: 7 additions & 0 deletions static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@
"title": "Clear cache",
"desc": "Clearing the Ledger Live cache forces network resynchronization. Your settings and accounts are not affected. The private keys to access your crypto assets in the blockchain remain secure on your Ledger device and on your Recovery sheet."
},
"resetFallbackModal": {
"part1": "Cache folder couldnt be deleted. You will have to delete it manually.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"part1": "Could not delete cache folder. Please delete the folder manually:",

"part2": "Click on \"Open folder\", then the ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"part2": "Click the Open folder button, the ",

"part3": "app will close",
"part4": ", and you will have to delete the \"sqlite\" folder.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"part4": ", make sure to delete the "sqlite" folder.",

"part5": "After that, you can restart the app."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"part5": "Then you can restart the app normally."

},
"removeAccountModal": {
"title": "Remove account",
"desc": "The account will no longer be included in your portfolio. This operation does not affect your assets. Accounts can always be re-added."
Expand Down