mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 13:47:16 +02:00
removed sso related code from client/store/index.js and renamed some functions in client/store/sso.js
This commit is contained in:
parent
27f498ffae
commit
53e6c9f913
@ -32,10 +32,6 @@ export const getters = {
|
||||
if (!state.serverSettings) return null
|
||||
return state.serverSettings[key]
|
||||
},
|
||||
getSSOSetting: state => key => {
|
||||
if (!state.SSOSettings) return null
|
||||
return state.getSSOSettings[key]
|
||||
},
|
||||
getBookCoverAspectRatio: state => {
|
||||
if (!state.serverSettings || !state.serverSettings.coverAspectRatio) return 1.6
|
||||
return state.serverSettings.coverAspectRatio === 0 ? 1.6 : 1
|
||||
@ -63,22 +59,6 @@ export const actions = {
|
||||
return false
|
||||
})
|
||||
},
|
||||
updateSSOSettings({ commit }, payload) {
|
||||
var updatePayload = {
|
||||
...payload
|
||||
}
|
||||
return this.$axios.$patch('/api/SSOSettings', updatePayload).then((result) => {
|
||||
if (result.success) {
|
||||
commit('setSSOSettings', result.SSOSettings)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('Failed to update server settings', error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
checkForUpdate({ commit }) {
|
||||
return checkForUpdate()
|
||||
.then((res) => {
|
||||
@ -126,10 +106,6 @@ export const mutations = {
|
||||
if (!settings) return
|
||||
state.serverSettings = settings
|
||||
},
|
||||
setSSOSettings(state, settings) {
|
||||
if (!settings) return
|
||||
state.SSOSettings = settings
|
||||
},
|
||||
setStreamAudiobook(state, audiobook) {
|
||||
state.playOnLoad = true
|
||||
state.streamAudiobook = audiobook
|
||||
|
@ -58,13 +58,13 @@ export const getters = {
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
updateUserSettings({ commit }, payload) {
|
||||
updateSSOSettings({ commit }, payload) {
|
||||
var updatePayload = {
|
||||
...payload
|
||||
}
|
||||
// Immediately update
|
||||
commit('setSSOSettings', updatePayload)
|
||||
return this.$axios.$patch('/api/sso/settings', updatePayload).then((result) => {
|
||||
return this.$axios.$patch('/api/SSOSettings', updatePayload).then((result) => {
|
||||
if (result.success) {
|
||||
commit('setSSOSettings', result.settings)
|
||||
return true
|
||||
@ -77,11 +77,6 @@ export const actions = {
|
||||
})
|
||||
},
|
||||
loadSSOSettings({ state, commit }) {
|
||||
return defaultSSOSettings
|
||||
if (state.collectionsLoaded) {
|
||||
console.log('Collections already loaded')
|
||||
return state.collections
|
||||
}
|
||||
|
||||
return this.$axios.$get('/api/collections').then((collections) => {
|
||||
commit('setCollections', collections)
|
||||
|
Loading…
Reference in New Issue
Block a user