diff --git a/src/CollectionsViewer.jsx b/src/CollectionsViewer.jsx index 9fdc99d..570b883 100644 --- a/src/CollectionsViewer.jsx +++ b/src/CollectionsViewer.jsx @@ -273,7 +273,7 @@ class CollectionViewer extends React.Component { )} {this.renderAdditionalTabs()} - {this.props.provider.isLocal && engine && engine.resetClient && ( + {this.props.provider.isLocal && engine && ( diff --git a/src/EngineActions.jsx b/src/EngineActions.jsx index 3b93705..12505ca 100644 --- a/src/EngineActions.jsx +++ b/src/EngineActions.jsx @@ -25,17 +25,47 @@ class EngineActions extends React.Component { }); } + wipe(event) { + let e = this.props.engine; + e._log.info("about:sync wiping engine due to user request"); + e.wipeServer().then(() => { + alert("Wipe complete"); + }).catch(err => { + console.error("Failed to wipe the engine", err); + }); + } + render() { + let reset; + if (this.props.engine.resetClient) { + reset = +
+ Resetting an engine clears all local state, so the next Sync will + act as though this was the first sync for that engine's data - + all records will be downloaded, compared against local records + and missing records uploaded - + + +
+ } + let canWipe = !["crypto", "meta"].includes(this.props.engine.name); + let wipe; + if (canWipe) { + wipe = +
+ Wiping an engine removes data from the server. It does not remove local data. + This device will upload all its data. Other devices will act like a Reset, as described above. + - + + +
+ }; return ( -
- Resetting an engine clears all local state, so the next Sync will - act as though this was the first sync for that engine's data - - all records will be downloaded, compared against local records - and missing records uploaded - - - -
- ); + <> + { reset } + { wipe } + + ); } }