diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 07a70744..eb99a75b 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -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' diff --git a/src/renderer/store/modules/history.js b/src/renderer/store/modules/history.js index 3869c0c5..ca0ca742 100644 --- a/src/renderer/store/modules/history.js +++ b/src/renderer/store/modules/history.js @@ -76,6 +76,10 @@ const actions = { dispatch('grabHistory') } }) + }, + + compactHistory (_) { + historyDb.persistence.compactDatafile() } } diff --git a/src/renderer/store/modules/profile.js b/src/renderer/store/modules/profile.js index f190673b..141db832 100644 --- a/src/renderer/store/modules/profile.js +++ b/src/renderer/store/modules/profile.js @@ -141,6 +141,10 @@ const actions = { }) }, + compactProfiles (_) { + profileDb.persistence.compactDatafile() + }, + updateActiveProfile ({ commit }, index) { commit('setActiveProfile', index) }