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

View File

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

View File

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

View File

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