Small cleanups & code improvements
This commit is contained in:
parent
f2c29d42dd
commit
187a8f5933
2 changed files with 9 additions and 8 deletions
|
@ -1,5 +1,9 @@
|
||||||
export const saveListView = (listId, routeName) => {
|
export const saveListView = (listId, routeName) => {
|
||||||
if(routeName.includes('settings.')) {
|
if (routeName.includes('settings.')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!listId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import router from '../../router'
|
|
||||||
|
|
||||||
import ListModel from '../../models/list'
|
import ListModel from '../../models/list'
|
||||||
import ListService from '../../services/list'
|
import ListService from '../../services/list'
|
||||||
import {CURRENT_LIST} from '@/store/mutation-types'
|
import {CURRENT_LIST} from '../../store/mutation-types'
|
||||||
import {getListView} from '@/helpers/saveListView'
|
import {getListView} from '../../helpers/saveListView'
|
||||||
import {saveListToHistory} from '../../modules/listHistory'
|
import {saveListToHistory} from '../../modules/listHistory'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -84,9 +82,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
replaceListView() {
|
replaceListView() {
|
||||||
const savedListView = getListView(this.$route.params.listId)
|
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)
|
console.debug('Replaced list view with', savedListView)
|
||||||
return
|
|
||||||
},
|
},
|
||||||
loadList() {
|
loadList() {
|
||||||
if (this.$route.name.includes('.settings.')) {
|
if (this.$route.name.includes('.settings.')) {
|
||||||
|
|
Loading…
Reference in a new issue