Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Commit f338390

Browse files
committed
Add clearSaveError to avoid page refresh
1 parent 86a4e57 commit f338390

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/js/components/Size.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ const chromeDocLink = 'https://developer.chrome.com/apps/storage#property-sync'
1414
@inject('AppStore')
1515
@observer
1616
export default class Size extends Component {
17-
handleClose = () => {
18-
window.location.reload()
19-
}
20-
2117
render () {
22-
const { saveError, size } = this.props.AppStore
18+
const { clearSaveError, saveError, size } = this.props.AppStore
2319
const alert = saveError && (
24-
<Dialog open onClose={this.handleClose}>
20+
<Dialog open onClose={clearSaveError}>
2521
<DialogTitle>Script Save Failure</DialogTitle>
2622
<DialogContent>
2723
<DialogContentText>
@@ -38,8 +34,8 @@ export default class Size extends Component {
3834
</DialogContentText>
3935
</DialogContent>
4036
<DialogActions>
41-
<Button onClick={this.handleClose} color='primary' autoFocus>
42-
Refresh
37+
<Button onClick={clearSaveError} color='primary' autoFocus>
38+
Try again
4339
</Button>
4440
</DialogActions>
4541
</Dialog>

src/js/stores/AppStore.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ export default class AppStore {
225225
chrome.runtime.sendMessage({ method: 'goTo', link: this.domain })
226226
}
227227

228+
@action
229+
clearSaveError = () => {
230+
this.saveError = null
231+
}
232+
228233
autoSave = () => {
229234
if (this.autoSaveHandle) {
230235
clearTimeout(this.autoSaveHandle)

0 commit comments

Comments
 (0)