From 53e6c9f91310a0484f60bccba7b5cfc5c198abd0 Mon Sep 17 00:00:00 2001 From: David Leimroth Date: Mon, 7 Feb 2022 17:05:12 +0100 Subject: [PATCH] removed sso related code from client/store/index.js and renamed some functions in client/store/sso.js --- client/store/index.js | 24 ------------------------ client/store/sso.js | 9 ++------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/client/store/index.js b/client/store/index.js index 2c0684e2a..443aabad0 100644 --- a/client/store/index.js +++ b/client/store/index.js @@ -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 diff --git a/client/store/sso.js b/client/store/sso.js index c9ee4d230..047a151d8 100644 --- a/client/store/sso.js +++ b/client/store/sso.js @@ -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)