Store/Settings: Remove unnecessary `updateInvidiousInstance` call
The 'grabUserSettings' action calls the 'updateInvidiousInstance' action whenever the database returns an empty value for this setting. However, that scenario should never happen in the first place. In addition, a default value is already provided directly in the state.
This commit is contained in:
parent
58bd0d1f36
commit
e4d7790d6d
|
@ -171,7 +171,7 @@ Object.assign(getters, {
|
|||
// Custom actions
|
||||
Object.assign(actions, {
|
||||
// Add `grabUserSettings` to actions
|
||||
grabUserSettings: ({ dispatch, commit }) => {
|
||||
grabUserSettings: ({ commit }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
settingsDb.find({}, (err, results) => {
|
||||
if (!err) {
|
||||
|
@ -179,14 +179,7 @@ Object.assign(actions, {
|
|||
results.forEach((result) => {
|
||||
switch (result._id) {
|
||||
case 'invidiousInstance':
|
||||
if (result.value === '') {
|
||||
dispatch(
|
||||
'updateInvidiousInstance',
|
||||
'https://invidious.snopyta.org'
|
||||
)
|
||||
} else {
|
||||
commit('setInvidiousInstance', result.value)
|
||||
}
|
||||
commit('setInvidiousInstance', result.value)
|
||||
break
|
||||
case 'backendFallback':
|
||||
commit('setBackendFallback', result.value)
|
||||
|
|
Loading…
Reference in New Issue