🐛 Fix(custom): fix start mode in mac and win

ISSUES CLOSED: #281
This commit is contained in:
Kuingsmile 2024-12-23 11:36:15 +08:00
parent 2bdd2d5982
commit 8815089c01
2 changed files with 9 additions and 2 deletions

View File

@ -169,7 +169,10 @@ class LifeCycle {
db.set(configPaths.settings.isListeningClipboard, false)
}
const isHideDock = db.get(configPaths.settings.isHideDock) || false
const startMode = db.get(configPaths.settings.startMode) || ISartMode.QUIET
let startMode = db.get(configPaths.settings.startMode) || ISartMode.QUIET
if (process.platform === 'darwin' && startMode === ISartMode.MINI) {
startMode = ISartMode.QUIET
}
const currentPicBed = db.get(configPaths.picBed.uploader) || db.get(configPaths.picBed.current) || 'smms'
const currentPicBedConfig = db.get(`picBed.${currentPicBed}`)?._configName || 'Default'
const tooltip = `${currentPicBed} ${currentPicBedConfig}`
@ -201,7 +204,7 @@ class LifeCycle {
}
await remoteNoticeHandler.init()
remoteNoticeHandler.triggerHook(IRemoteNoticeTriggerHook.APP_START)
if (startMode === ISartMode.MINI) {
if (startMode === ISartMode.MINI && process.platform !== 'darwin') {
windowManager.create(IWindowList.MINI_WINDOW)
const miniWindow = windowManager.get(IWindowList.MINI_WINDOW)!
miniWindow.removeAllListeners()

View File

@ -1258,6 +1258,10 @@ async function initData() {
formOfSetting.value.autoImportPicBed = initArray(settings.autoImportPicBed || [], [])
currentLanguage.value = valueToOptionItem(settings.language || 'zh-CN', languageList)
currentStartMode.value = valueToOptionItem(settings.startMode || ISartMode.QUIET, startModeList)
if (osGlobal.value === 'darwin' && currentStartMode.value.value === ISartMode.MINI) {
currentStartMode.value = valueToOptionItem(ISartMode.QUIET, startModeList)
saveConfig(configPaths.settings.startMode, ISartMode.QUIET)
}
currentManualPageOpen.value = valueToOptionItem(settings.manualPageOpen || 'window', manualPageOpenList)
currentShortUrlServer.value = valueToOptionItem(settings.shortUrlServer || 'c1n', shortUrlServerList)
customLink.value = settings.customLink || '![$fileName]($url)'