fix: avoid sending language settings multiple times

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2534>
This commit is contained in:
Kasper Seweryn 2023-07-25 14:25:44 +02:00 committed by Marge
parent 9625732b08
commit 4525d083af
1 changed files with 3 additions and 1 deletions

View File

@ -225,7 +225,9 @@ const store: Module<State, RootState> = {
commit('notifications', { type: 'pendingReviewRequests', count: response.data.count })
},
async currentLanguage ({ commit, rootState }, value) {
async currentLanguage ({ commit, rootState, state }, value) {
if (state.selectedLanguage && state.currentLanguage === value) return
commit('currentLanguage', value)
if (rootState.auth.authenticated) {
await axios.post('users/settings', { language: value })