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
|
// Custom actions
|
||||||
Object.assign(actions, {
|
Object.assign(actions, {
|
||||||
// Add `grabUserSettings` to actions
|
// Add `grabUserSettings` to actions
|
||||||
grabUserSettings: ({ dispatch, commit }) => {
|
grabUserSettings: ({ commit }) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
settingsDb.find({}, (err, results) => {
|
settingsDb.find({}, (err, results) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
@ -179,14 +179,7 @@ Object.assign(actions, {
|
||||||
results.forEach((result) => {
|
results.forEach((result) => {
|
||||||
switch (result._id) {
|
switch (result._id) {
|
||||||
case 'invidiousInstance':
|
case 'invidiousInstance':
|
||||||
if (result.value === '') {
|
commit('setInvidiousInstance', result.value)
|
||||||
dispatch(
|
|
||||||
'updateInvidiousInstance',
|
|
||||||
'https://invidious.snopyta.org'
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
commit('setInvidiousInstance', result.value)
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
case 'backendFallback':
|
case 'backendFallback':
|
||||||
commit('setBackendFallback', result.value)
|
commit('setBackendFallback', result.value)
|
||||||
|
|
Loading…
Reference in New Issue