Skip to content

Commit

Permalink
✨ Add a button to clear the database
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Aug 27, 2020
1 parent 2a0a69a commit ec5aa50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/NavigationBar/EditMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
blockCount
}) }}</b-dropdown-item>
<b-dropdown-item @click="cleanUp">{{ $t('edit.cleanup') }}</b-dropdown-item>
<b-dropdown-item @click="clearDB">{{ $t('edit.cleardb') }}</b-dropdown-item>
</b-nav-item-dropdown>
</template>

Expand All @@ -30,6 +31,9 @@ export default {
},
cleanUp(){
this.$store.state.workspace.cleanUp();
},
clearDB(){
localStorage.setItem('easyjsondatabase', '{}');
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const websiteMessages = {
undo: "Undo",
redo: "Redo",
clear: "Clear {blockCount} blocks",
cleanup: "Clean up blocks"
cleanup: "Clean up blocks",
cleardb: "Clear the database"
},
lang: {
title: "Language"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const websiteMessages = {
undo: "Annuler",
redo: "Rétablir",
clear: "Nettoyer {blockCount} blocks",
cleanup: "Réorganiser les blocks"
cleanup: "Réorganiser les blocks",
cleardb: "Effacer la base de données"
},
lang: {
title: "Langue"
Expand Down

0 comments on commit ec5aa50

Please sign in to comment.