fix update-window-size is no effect on windows

This commit is contained in:
geekgeekrun
2025-04-26 22:10:34 +08:00
parent 6f9533c2b7
commit f6e1b799ce
4 changed files with 5 additions and 4 deletions
@@ -18,6 +18,7 @@ export default function initPublicIpc() {
if (!win) { if (!win) {
return return
} }
win.setMinimumSize(size.width, size.height)
win.setSize(size.width, size.height, size.animate) win.setSize(size.width, size.height, size.animate)
} }
) )
@@ -15,7 +15,6 @@ export function createLlmConfigWindow(
resizable: false, resizable: false,
show: false, show: false,
autoHideMenuBar: true, autoHideMenuBar: true,
frame: false,
webPreferences: { webPreferences: {
preload: path.join(__dirname, '../preload/index.js'), preload: path.join(__dirname, '../preload/index.js'),
sandbox: false sandbox: false
@@ -15,7 +15,6 @@ export function createResumeEditorWindow(
resizable: true, resizable: true,
show: false, show: false,
autoHideMenuBar: true, autoHideMenuBar: true,
// frame: false,
webPreferences: { webPreferences: {
preload: path.join(__dirname, '../preload/index.js'), preload: path.join(__dirname, '../preload/index.js'),
sandbox: false sandbox: false
@@ -257,6 +257,7 @@ import { ref, onMounted, watch, nextTick, computed } from 'vue'
import { gtagRenderer } from '@renderer/utils/gtag' import { gtagRenderer } from '@renderer/utils/gtag'
import { SINGLE_ITEM_DEFAULT_SERVE_WEIGHT } from '../../../../common/constant' import { SINGLE_ITEM_DEFAULT_SERVE_WEIGHT } from '../../../../common/constant'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import { sleep } from '@geekgeekrun/utils/sleep.mjs'
interface LlmConfigItem { interface LlmConfigItem {
id: string id: string
providerCompleteApiUrl: string providerCompleteApiUrl: string
@@ -498,11 +499,12 @@ function removeConfig(index) {
watch( watch(
() => formContent.value.length, () => formContent.value.length,
(nVal) => { async (nVal) => {
await sleep(100)
if (nVal <= 1) { if (nVal <= 1) {
electron.ipcRenderer.send('update-window-size', { electron.ipcRenderer.send('update-window-size', {
width: window.innerWidth, width: window.innerWidth,
height: 550 height: 576
}) })
} else { } else {
electron.ipcRenderer.send('update-window-size', { electron.ipcRenderer.send('update-window-size', {