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

refactor: migration to pinia

This commit is contained in:
2022-04-30 00:47:37 +02:00
parent e9dedfaf32
commit 0d52282aa8
75 changed files with 2079 additions and 1814 deletions

View File

@@ -26,11 +26,13 @@
<script>
import { defineAsyncComponent } from 'vue';
import { mapGetters } from 'vuex';
import { storeToRefs } from 'pinia';
import { ipcRenderer } from 'electron';
import { Menu, getCurrentWindow } from '@electron/remote';
import { useApplicationStore } from '@/stores/application';
import { useConnectionsStore } from '@/stores/connections';
import { useSettingsStore } from '@/stores/settings';
import { useWorkspacesStore } from '@/stores/workspaces';
import TheSettingBar from '@/components/TheSettingBar';
export default {
@@ -48,30 +50,32 @@ export default {
},
setup () {
const applicationStore = useApplicationStore();
const connectionsStore = useConnectionsStore();
const settingsStore = useSettingsStore();
const workspacesStore = useWorkspacesStore();
const {
isLoading,
isSettingModal,
isScratchpad
} = storeToRefs(applicationStore);
const { connections } = storeToRefs(connectionsStore);
const { applicationTheme, disableBlur } = storeToRefs(settingsStore);
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
const { checkVersionUpdate } = applicationStore;
return {
applicationStore,
isLoading,
isSettingModal,
isScratchpad,
checkVersionUpdate
checkVersionUpdate,
connections,
applicationTheme,
disableBlur,
selectedWorkspace
};
},
computed: {
...mapGetters({
connections: 'connections/getConnections',
applicationTheme: 'settings/getApplicationTheme',
disableBlur: 'settings/getDisableBlur',
selectedWorkspace: 'workspaces/getSelected'
})
},
mounted () {
ipcRenderer.send('check-for-updates');
this.checkVersionUpdate();