Small cleanups & code improvements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kolaente 2021-08-06 23:34:37 +02:00
parent f2c29d42dd
commit 187a8f5933
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 9 additions and 8 deletions

View File

@ -3,6 +3,10 @@ export const saveListView = (listId, routeName) => {
return
}
if (!listId) {
return
}
const savedListView = localStorage.getItem('listView')
let savedListViewJson = false
if (savedListView !== null) {

View File

@ -38,12 +38,10 @@
</template>
<script>
import router from '../../router'
import ListModel from '../../models/list'
import ListService from '../../services/list'
import {CURRENT_LIST} from '@/store/mutation-types'
import {getListView} from '@/helpers/saveListView'
import {CURRENT_LIST} from '../../store/mutation-types'
import {getListView} from '../../helpers/saveListView'
import {saveListToHistory} from '../../modules/listHistory'
export default {
@ -84,9 +82,8 @@ export default {
methods: {
replaceListView() {
const savedListView = getListView(this.$route.params.listId)
router.replace({name: savedListView, params: {id: this.$route.params.listId}})
this.$router.replace({name: savedListView, params: {id: this.$route.params.listId}})
console.debug('Replaced list view with', savedListView)
return
},
loadList() {
if (this.$route.name.includes('.settings.')) {