Skip to content

Commit a5ceef5

Browse files
committed
fix(stage-tamagotchi): set default window size
1 parent 94aa845 commit a5ceef5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

apps/stage-tamagotchi/src/main/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ app.whenReady().then(() => {
191191
})
192192

193193
ipcMain.on('window-size-changed', (_, width: number, height: number) => {
194+
if (width === 0 || height === 0) {
195+
mainWindow.setSize(300 * 1.5, 400 * 1.5) // back to default size
196+
return
197+
}
194198
mainWindow.setSize(width, height)
195199
})
196200

apps/stage-tamagotchi/src/renderer/src/stores/window-controls.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { WindowControlMode } from '../types/window-controls'
77
export const useWindowControlStore = defineStore('windowControl', () => {
88
const controlMode = ref<WindowControlMode>(WindowControlMode.DEFAULT)
99
const isControlActive = ref(false)
10-
const size = useLocalStorage('window/control/size', { width: 0, height: 0 })
10+
const size = useLocalStorage('window/control/size', { width: 300 * 1.5, height: 400 * 1.5 })
1111
const position = useLocalStorage('window/control/position', { x: 0, y: 0 })
1212

1313
function setMode(mode: WindowControlMode) {

0 commit comments

Comments
 (0)