Added check for database delete to see that the db is available

This commit is contained in:
Mitchell McCaffrey
2021-03-18 12:57:19 +11:00
parent 100a8f8fab
commit c316f21020

View File

@@ -141,7 +141,11 @@ function SettingsModal({ isOpen, onRequestClose }) {
</Label>
<Divider bg="text" />
<Flex py={2}>
<Button sx={{ flexGrow: 1 }} onClick={handleClearCache}>
<Button
sx={{ flexGrow: 1 }}
onClick={handleClearCache}
disabled={!database}
>
Clear cache
</Button>
</Flex>
@@ -149,6 +153,7 @@ function SettingsModal({ isOpen, onRequestClose }) {
<Button
sx={{ flexGrow: 1 }}
onClick={() => setIsDeleteModalOpen(true)}
disabled={!database}
>
Erase all content and reset
</Button>