Prevent deleted history and profile data from being exported
Closes: #934, #937 This assures that the profiles and history datastores are properly compacted before their respective exports
This commit is contained in:
parent
c4afaaaf06
commit
5f4ea74c16
|
@ -573,7 +573,8 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
|
||||
exportFreeTubeSubscriptions: function () {
|
||||
exportFreeTubeSubscriptions: async function () {
|
||||
await this.compactProfiles()
|
||||
const userData = app.getPath('userData')
|
||||
const subscriptionsDb = `${userData}/profiles.db`
|
||||
const date = new Date()
|
||||
|
@ -949,7 +950,8 @@ export default Vue.extend({
|
|||
})
|
||||
},
|
||||
|
||||
exportHistory: function () {
|
||||
exportHistory: async function () {
|
||||
await this.compactHistory()
|
||||
const userData = app.getPath('userData')
|
||||
const historyDb = `${userData}/history.db`
|
||||
const date = new Date()
|
||||
|
@ -1106,8 +1108,10 @@ export default Vue.extend({
|
|||
...mapActions([
|
||||
'invidiousAPICall',
|
||||
'updateProfile',
|
||||
'compactProfiles',
|
||||
'updateShowProgressBar',
|
||||
'updateHistory',
|
||||
'compactHistory',
|
||||
'showToast',
|
||||
'getRandomColor',
|
||||
'calculateColorLuminance'
|
||||
|
|
|
@ -76,6 +76,10 @@ const actions = {
|
|||
dispatch('grabHistory')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
compactHistory (_) {
|
||||
historyDb.persistence.compactDatafile()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ const actions = {
|
|||
})
|
||||
},
|
||||
|
||||
compactProfiles (_) {
|
||||
profileDb.persistence.compactDatafile()
|
||||
},
|
||||
|
||||
updateActiveProfile ({ commit }, index) {
|
||||
commit('setActiveProfile', index)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue