Merge pull request #1114 from GilgusMaximus/defaultProfile

Profile loading inconsistency
This commit is contained in:
Luca Hohmann 2021-03-27 19:11:59 +01:00 committed by GitHub
commit 726b521e38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 171 additions and 166 deletions

View File

@ -85,7 +85,7 @@ export default Vue.extend({
}
},
mounted: function () {
this.$store.dispatch('grabUserSettings')
this.$store.dispatch('grabUserSettings').then((result) => {
this.$store.dispatch('grabHistory')
this.$store.dispatch('grabAllProfiles', this.$t('Profile.All Channels'))
this.$store.dispatch('grabAllPlaylists')
@ -105,6 +105,7 @@ export default Vue.extend({
this.checkForNewUpdates()
this.checkForNewBlogPosts()
}, 500)
})
},
methods: {
checkLocale: function () {

View File

@ -13,7 +13,6 @@ if (window && window.process && window.process.type === 'renderer') {
const remote = require('@electron/remote')
dbLocation = remote.app.getPath('userData')
dbLocation = dbLocation + '/history.db'
} else {
dbLocation = 'history.db'

View File

@ -103,7 +103,7 @@ const actions = {
textColor: textColor,
subscriptions: []
}
console.log(defaultProfile)
profileDb.update({ _id: 'allChannels' }, defaultProfile, { upsert: true }, (err, numReplaced) => {
if (!err) {
dispatch('grabAllProfiles')

View File

@ -264,6 +264,7 @@ const getters = {
const actions = {
grabUserSettings ({ dispatch, commit, rootState }) {
return new Promise((resolve, reject) => {
settingsDb.find({}, (err, results) => {
if (!err) {
console.log(results)
@ -280,6 +281,7 @@ const actions = {
commit('setBackendFallback', result.value)
break
case 'defaultProfile':
console.log('IN SETTING DEFAULT:', result.value)
commit('setDefaultProfile', result.value)
break
case 'checkForUpdates':
@ -409,7 +411,10 @@ const actions = {
break
}
})
resolve()
}
reject(err)
})
})
},