1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

refactor: initial pinia implementation

This commit is contained in:
2022-04-27 18:23:48 +02:00
parent 0821586bb3
commit 9dd685b062
14 changed files with 183 additions and 46 deletions

View File

@ -320,6 +320,8 @@
<script>
import { shell } from 'electron';
import { mapActions, mapGetters } from 'vuex';
import { storeToRefs } from 'pinia';
import { useApplicationStore } from '@/stores/application';
import localesNames from '@/i18n/supported-locales';
import ModalSettingsUpdate from '@/components/ModalSettingsUpdate';
import ModalSettingsChangelog from '@/components/ModalSettingsChangelog';
@ -332,6 +334,27 @@ export default {
ModalSettingsChangelog,
BaseTextEditor
},
setup () {
const applicationStore = useApplicationStore();
const {
selectedSettingTab,
updateStatus
} = storeToRefs(applicationStore);
const {
hideSettingModal,
appName,
appVersion
} = applicationStore;
return {
appName,
appVersion,
selectedSettingTab,
updateStatus,
closeModal: hideSettingModal
};
},
data () {
return {
appAuthor: 'Fabio Di Stasio',
@ -395,9 +418,6 @@ export default {
},
computed: {
...mapGetters({
appName: 'application/appName',
appVersion: 'application/appVersion',
selectedSettingTab: 'application/selectedSettingTab',
selectedLocale: 'settings/getLocale',
pageSize: 'settings/getDataTabLimit',
selectedAutoComplete: 'settings/getAutoComplete',
@ -408,7 +428,6 @@ export default {
applicationTheme: 'settings/getApplicationTheme',
editorTheme: 'settings/getEditorTheme',
editorFontSize: 'settings/getEditorFontSize',
updateStatus: 'application/getUpdateStatus',
selectedWorkspace: 'workspaces/getSelected',
getWorkspace: 'workspaces/getWorkspace'
}),
@ -462,7 +481,6 @@ ORDER BY
},
methods: {
...mapActions({
closeModal: 'application/hideSettingModal',
changeLocale: 'settings/changeLocale',
changePageSize: 'settings/changePageSize',
changeRestoreTabs: 'settings/changeRestoreTabs',