Working better :)

This commit is contained in:
Henrique Dias committed 2017-07-03 11:04:14 +01:00
1 parent 85e01a67c3
commit 191b31e977
17 files changed
+99 -54

No files matched your search

+17 -2
View File
@@ -93,6 +93,7 @@ import NewFilePrompt from './NewFilePrompt'
import NewDirPrompt from './NewDirPrompt'
import css from '@/utils/css'
import auth from '@/utils/auth'
import api from '@/utils/api'
import {mapGetters, mapState} from 'vuex'
function updateColumnSizes () {
@@ -149,7 +150,21 @@ export default {
plugins: []
}
},
mounted: function () {
beforeRouteEnter (to, from, next) {
api.fetch(to.params[0])
.then(() => {
next()
})
.catch(error => {
// TODO: 404, 403 and 500!
console.log(error)
window.alert('Something went wrong. Please reload.')
})
},
beforeRouteUpdate (to, from, next) {
console.log('hey')
},
mounted () {
updateColumnSizes()
window.addEventListener('resize', updateColumnSizes)
@@ -157,7 +172,7 @@ export default {
this.plugins = window.plugins
}
document.title = this.req.data.name
document.title = this.req.name
window.history.replaceState({
url: window.location.pathname,
name: document.title