Browse Source

fix error on first annotation page open

At first `checkpoint` localstorage entry does not exist, so
`checkpoint` variable ends up to be `null`.
pull/473/head
Kirill Krolik 5 years ago
committed by Kirill Krolik
parent
commit
a8cf6133b8
No known key found for this signature in database GPG Key ID: 54F7FD2198644FB2
1 changed files with 1 additions and 1 deletions
  1. 2
      frontend/store/pagination.js

2
frontend/store/pagination.js

@ -29,7 +29,7 @@ export const mutations = {
localStorage.setItem('checkpoint', JSON.stringify(checkpoint))
},
loadPage(state) {
const checkpoint = JSON.parse(localStorage.getItem('checkpoint'))
const checkpoint = JSON.parse(localStorage.getItem('checkpoint')) || {}
state.page = checkpoint[state.projectId] ? checkpoint[state.projectId] : 1
},
setProjectId(state, projectId) {

Loading…
Cancel
Save