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:
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user