Skip to content

Commit

Permalink
GH-114 Cache configuration by frontend to avoid flickering (Fix #114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Jun 17, 2020
1 parent 454dd50 commit 0b0c7d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions reposilite-frontend/src/views/Index.vue
Expand Up @@ -66,9 +66,16 @@ export default {
created() {
this.message = window.REPOSILITE_MESSAGE
if (sessionStorage.configuration) {
this.configuration = JSON.parse(sessionStorage.configuration)
}
this.api('/configuration', {})
.then(response => (this.configuration = response.data))
.catch(err => (this.response = err.response.data))
.then(response => {
this.configuration = response.data
sessionStorage.configuration = JSON.stringify(this.configuration)
})
.catch(err => this.response = err.response.data)
},
mounted() {
this.updateEntities()
Expand Down

0 comments on commit 0b0c7d6

Please sign in to comment.