|
@@ -113,7 +113,9 @@ export default class GoldenRetriever extends BasePlugin {
|
|
|
|
|
|
// If all files have been removed by the user, clear recovery state
|
|
// If all files have been removed by the user, clear recovery state
|
|
if (Object.keys(filesToSave).length === 0) {
|
|
if (Object.keys(filesToSave).length === 0) {
|
|
- this.uppy.setState({ recoveredState: null })
|
|
|
|
|
|
+ if (this.uppy.getState().recoveredState !== null) {
|
|
|
|
+ this.uppy.setState({ recoveredState: null })
|
|
|
|
+ }
|
|
MetaDataStore.cleanup(this.uppy.opts.id)
|
|
MetaDataStore.cleanup(this.uppy.opts.id)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -350,7 +352,6 @@ export default class GoldenRetriever extends BasePlugin {
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.uppy.log('[GoldenRetriever] No files need to be loaded, only restoring processing state...')
|
|
this.uppy.log('[GoldenRetriever] No files need to be loaded, only restoring processing state...')
|
|
- this.onBlobsLoaded([])
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -361,6 +362,9 @@ export default class GoldenRetriever extends BasePlugin {
|
|
this.uppy.on('file-added', this.addBlobToStores)
|
|
this.uppy.on('file-added', this.addBlobToStores)
|
|
this.uppy.on('file-editor:complete', this.replaceBlobInStores)
|
|
this.uppy.on('file-editor:complete', this.replaceBlobInStores)
|
|
this.uppy.on('file-removed', this.removeBlobFromStores)
|
|
this.uppy.on('file-removed', this.removeBlobFromStores)
|
|
|
|
+ // TODO: the `state-update` is bad practise. It fires on any state change in Uppy
|
|
|
|
+ // or any state change in any of the plugins. We should to able to only listen
|
|
|
|
+ // for the state changes we need, somehow.
|
|
this.uppy.on('state-update', this.saveFilesStateToLocalStorage)
|
|
this.uppy.on('state-update', this.saveFilesStateToLocalStorage)
|
|
this.uppy.on('restore-confirmed', this.handleRestoreConfirmed)
|
|
this.uppy.on('restore-confirmed', this.handleRestoreConfirmed)
|
|
this.uppy.on('restore-canceled', this.abortRestore)
|
|
this.uppy.on('restore-canceled', this.abortRestore)
|