update library opening strategy

This commit is contained in:
axolotle
2021-06-10 18:26:14 +02:00
parent ddff9313cb
commit ecc5253f38
9 changed files with 169 additions and 160 deletions
+1 -13
View File
@@ -28,19 +28,7 @@ export default [
options: () => import(/* webpackChunkName: "library" */ '@/pages/library/LibraryOptions')
},
props: {
default: ({ query }) => {
let { mode = 'tree-map', texts = [] } = query
if (typeof texts === 'string') texts = [texts]
// In case of a reload or direct link, vue-router doesn't turn the query string into an array.
if (texts && texts.length && typeof texts[0] === 'string') {
texts = texts.map(text => text.split(',').map(id => parseInt(id)))
}
return { mode, texts }
},
options: ({ query }) => ({
show: !('texts' in query && query.texts.length),
mode: query.mode || 'tree-map'
})
default: ({ query }) => ({ query })
}
},