From 62fd24fd7a705267106fb5493d3ba0dbe0955165 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Tue, 16 Apr 2019 11:29:07 -0400 Subject: [PATCH] add reset database button --- app/components/ContractAdmin.jsx | 33 +++++++++++++++++++------------ app/components/MainCointainer.jsx | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/components/ContractAdmin.jsx b/app/components/ContractAdmin.jsx index 8e532b3..18ea2f8 100644 --- a/app/components/ContractAdmin.jsx +++ b/app/components/ContractAdmin.jsx @@ -1,21 +1,28 @@ import React, { Fragment } from 'react' -import Button from '@material-ui/core/Button' +import { Button, Divider } from '@material-ui/core' import { FundingContext } from '../context' -import SetMockedTime from './SetMockedTime' +import database from '../db' + + +async function resetDb(openSnackBar) { + await database.unsafeResetDatabase() + openSnackBar('success', 'Database has been reset. Refresh the page to populate it') +} const ContractAdmin = () => ( - {({ needsInit, initVaultAndLP, standardTokenApproval }) => - - {needsInit && } - - - - } + {({ needsInit, initVaultAndLP, standardTokenApproval, openSnackBar }) => + + + + {needsInit && } + {needsInit && } + + } ) diff --git a/app/components/MainCointainer.jsx b/app/components/MainCointainer.jsx index 85493e9..132349a 100644 --- a/app/components/MainCointainer.jsx +++ b/app/components/MainCointainer.jsx @@ -183,7 +183,7 @@ class PersistentDrawerLeft extends React.Component { - +