1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

remove saveDbName method (refactor)

This commit is contained in:
lana-k
2020-12-27 18:03:04 +01:00
parent 1150b2e7c4
commit 34764a6e33
5 changed files with 11 additions and 13 deletions

View File

@@ -78,8 +78,8 @@ export default {
loadDb () {
this.state = 'drop'
return Promise.all([this.$db.loadDb(this.$refs.file.files[0]), this.animationPromise])
.then(([schema]) => {
this.$store.commit('saveSchema', schema)
.then(([{ dbName, schema }]) => {
this.$store.commit('saveSchema', { dbName, schema })
if (this.$route.path !== '/editor') {
this.$router.push('/editor')
}

View File

@@ -65,8 +65,8 @@ export default {
methods: {
changeDb () {
this.$db.loadDb(this.$refs.dbfile.files[0])
.then((schema) => {
this.$store.commit('saveSchema', schema)
.then(({ dbName, schema }) => {
this.$store.commit('saveSchema', { dbName, schema })
})
}
}