Make reload work

pull/144/head
Henrique Dias 2017-07-03 15:57:07 +01:00
parent 4ddee7cd75
commit 9e42f0f1ed
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
8 changed files with 14 additions and 9 deletions

View File

@ -142,7 +142,7 @@ export default {
Promise.all(promises)
.then(() => {
// page.reload()
this.$store.commit('setReload', true)
// buttons.setDone('upload')
})
.catch(e => {

View File

@ -91,7 +91,7 @@ export default {
Promise.all(promises)
.then(() => {
// page.reload()
this.$store.commit('setReload', true)
})
.catch(error => console.log(error))
},

View File

@ -136,6 +136,7 @@ export default {
...mapState([
'req',
'user',
'reload',
'baseURL',
'multiple',
'showInfo',
@ -167,7 +168,11 @@ export default {
this.fetchData()
},
watch: {
'$route': 'fetchData'
'$route': 'fetchData',
'reload': function () {
this.$store.commit('setReload', false)
this.fetchData()
}
},
mounted () {
updateColumnSizes()

View File

@ -110,7 +110,7 @@ export default {
conn.onclose = (event) => {
this.ongoing = false
this.scrollable.scrollTop = this.scrollable.scrollHeight
// page.reload()
this.$store.commit('setReload', true)
}
return

View File

@ -54,12 +54,12 @@ export default {
Promise.all(promises)
.then(() => {
// page.reload()
this.$store.commit('setReload', true)
// buttons.setDone('delete')
})
.catch(error => {
console.log(error)
// page.reload()
this.$store.commit('setReload', true)
// buttons.setDone('delete', false)
})
}

View File

@ -61,10 +61,8 @@ export default {
return
}
// TODO: keep selected after reload?
// page.reload()
// buttons.setDone('rename')
console.log('reload')
this.$router.go({ path: this.$route.path })
this.$store.commit('setReload', true)
}).catch(error => {
// buttons.setDone('rename', false)
console.log(error)

View File

@ -17,6 +17,7 @@ const mutations = {
state.showNewDir = false
state.showDownload = false
},
setReload: (state, value) => (state.reload = value),
setUser: (state, value) => (state.user = value),
setJWT: (state, value) => (state.jwt = value),
multiple: (state, value) => (state.multiple = value),

View File

@ -11,6 +11,7 @@ const state = {
baseURL: document.querySelector('meta[name="base"]').getAttribute('content'),
ssl: (window.location.protocol === 'https:'),
jwt: '',
reload: false,
selected: [],
multiple: false,
showInfo: false,