File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ onMounted(async () => {
3535 generateColorVars ()
3636
3737 await appStore .$tauri .start ()
38+ await appStore .init ()
3839 await modelStore .$tauri .start ()
3940 await modelStore .init ()
4041 await catStore .$tauri .start ()
Original file line number Diff line number Diff line change @@ -78,15 +78,15 @@ watch(() => modelStore.currentModel, async (model) => {
7878 }
7979}, { deep: true , immediate: true })
8080
81- watch ([() => catStore .scale , modelSize ], async () => {
82- if (! modelSize . value ) return
81+ watch ([() => catStore .scale , modelSize ], async ([ scale , modelSize ] ) => {
82+ if (! modelSize ) return
8383
84- const { width, height } = modelSize . value
84+ const { width, height } = modelSize
8585
8686 appWindow .setSize (
8787 new PhysicalSize ({
88- width: Math .round (width * (catStore . scale / 100 )),
89- height: Math .round (height * (catStore . scale / 100 )),
88+ width: Math .round (width * (scale / 100 )),
89+ height: Math .round (height * (scale / 100 )),
9090 }),
9191 )
9292}, { immediate: true })
Original file line number Diff line number Diff line change @@ -2,21 +2,22 @@ import type { WindowState } from '@/composables/useWindowState'
22
33import { getName , getVersion } from '@tauri-apps/api/app'
44import { defineStore } from 'pinia'
5- import { onMounted , reactive , ref } from 'vue'
5+ import { reactive , ref } from 'vue'
66
77export const useAppStore = defineStore ( 'app' , ( ) => {
88 const name = ref ( '' )
99 const version = ref ( '' )
1010 const windowState = reactive < WindowState > ( { } )
1111
12- onMounted ( async ( ) => {
12+ const init = async ( ) => {
1313 name . value = await getName ( )
1414 version . value = await getVersion ( )
15- } )
15+ }
1616
1717 return {
1818 name,
1919 version,
2020 windowState,
21+ init,
2122 }
2223} )
You can’t perform that action at this time.
0 commit comments