aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-13 20:40:19 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-13 20:40:19 -0500
commit4eb4ef6e073652661dcfa30597f63e93058fb876 (patch)
tree39b6c2aa22efb8e88cd3bc29559ba420e183f08f /src/client/views/Main.tsx
parentf3544f004a696e4682fbd8d1f18ac69beec59439 (diff)
Added clear database button
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 0f06f1278..376876ebb 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -95,6 +95,10 @@ Utils.EmitCallback(Server.Socket, MessageStore.GetField, "dash", (res: any) => {
}));
})
+ let clearDatabase = action(() => {
+ Utils.Emit(Server.Socket, MessageStore.DeleteAll, {});
+ })
+
ReactDOM.render((
<div style={{ position: "absolute", width: "100%", height: "100%" }}>
<DocumentView Document={mainContainer} ContainingCollectionView={undefined} DocumentView={undefined} />
@@ -118,6 +122,12 @@ Utils.EmitCallback(Server.Socket, MessageStore.GetField, "dash", (res: any) => {
left: '0px',
width: '150px'
}} onClick={addColNode}>Add Collection</button>
+ <button style={{
+ position: 'absolute',
+ bottom: '75px',
+ left: '0px',
+ width: '150px'
+ }} onClick={clearDatabase}>Clear Database</button>
</div>),
document.getElementById('root'));
})