@@ -233,6 +244,7 @@
import { mapActions, mapGetters } from 'vuex';
import localesNames from '@/i18n/supported-locales';
import ModalSettingsUpdate from '@/components/ModalSettingsUpdate';
+import ModalSettingsChangelog from '@/components/ModalSettingsChangelog';
import BaseTextEditor from '@/components/BaseTextEditor';
const { shell } = require('electron');
@@ -240,6 +252,7 @@ export default {
name: 'ModalSettings',
components: {
ModalSettingsUpdate,
+ ModalSettingsChangelog,
BaseTextEditor
},
data () {
@@ -394,53 +407,58 @@ ORDER BY
diff --git a/src/renderer/i18n/en-US.js b/src/renderer/i18n/en-US.js
index 542779ad..f17b2063 100644
--- a/src/renderer/i18n/en-US.js
+++ b/src/renderer/i18n/en-US.js
@@ -103,7 +103,8 @@ module.exports = {
processes: 'Processes',
database: 'Database',
scratchpad: 'Scratchpad',
- array: 'Array'
+ array: 'Array',
+ changelog: 'Changelog'
},
message: {
appWelcome: 'Welcome to Antares SQL Client!',
diff --git a/src/renderer/store/modules/application.store.js b/src/renderer/store/modules/application.store.js
index f210fda1..ec70b78f 100644
--- a/src/renderer/store/modules/application.store.js
+++ b/src/renderer/store/modules/application.store.js
@@ -1,10 +1,14 @@
'use strict';
+import Store from 'electron-store';
+const persistentStore = new Store({ name: 'settings' });
+
export default {
namespaced: true,
strict: true,
state: {
app_name: 'Antares - SQL Client',
app_version: process.env.PACKAGE_VERSION || 0,
+ cached_version: persistentStore.get('cached_version', 0),
is_loading: false,
is_new_modal: false,
is_setting_modal: false,
@@ -19,6 +23,7 @@ export default {
isLoading: state => state.is_loading,
appName: state => state.app_name,
appVersion: state => state.app_version,
+ cachedVersion: state => state.cached_version,
getBaseCompleter: state => state.base_completer,
getSelectedConnection: state => state.selected_conection,
isNewModal: state => state.is_new_modal,
@@ -54,6 +59,10 @@ export default {
HIDE_SCRATCHPAD (state) {
state.is_scratchpad = false;
},
+ CHANGE_CACHED_VERSION (state) {
+ state.cached_version = state.app_version;
+ persistentStore.set('cached_version', state.cached_version);
+ },
CHANGE_UPDATE_STATUS (state, status) {
state.update_status = status;
},
@@ -62,6 +71,12 @@ export default {
}
},
actions: {
+ checkVersionUpdate ({ getters, commit, dispatch }) {
+ if (getters.appVersion !== getters.cachedVersion) {
+ dispatch('showSettingModal', 'changelog');
+ commit('CHANGE_CACHED_VERSION');
+ }
+ },
setLoadingStatus ({ commit }, payload) {
commit('SET_LOADING_STATUS', payload);
},