mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-02 01:05:25 +02:00
New data model update bookmarks and bookmark routes to use API
This commit is contained in:
parent
099ae7c776
commit
14a8f84446
8 changed files with 143 additions and 156 deletions
|
@ -26,6 +26,10 @@ export const getters = {
|
|||
if (!state.user.libraryItemProgress) return null
|
||||
return state.user.libraryItemProgress.find(li => li.id == libraryItemId)
|
||||
},
|
||||
getUserBookmarksForItem: (state) => (libraryItemId) => {
|
||||
if (!state.user.bookmarks) return []
|
||||
return state.user.bookmarks.filter(bm => bm.libraryItemId === libraryItemId)
|
||||
},
|
||||
getUserSetting: (state) => (key) => {
|
||||
return state.settings ? state.settings[key] : null
|
||||
},
|
||||
|
@ -97,7 +101,6 @@ export const actions = {
|
|||
export const mutations = {
|
||||
setUser(state, user) {
|
||||
state.user = user
|
||||
|
||||
if (user) {
|
||||
if (user.token) localStorage.setItem('token', user.token)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue